Hi
I'm using ModelMultipleChoiceField with a large number of objects. I want to show only the selected objects and let the user remove a choice with js. To add choices the user will open a popup similar to ManyToManyRawIdWidget.
I can limit the queryset to the selected choices in the init of the form with:
def __init__(self, *args, **kwargs):
super(FormName, self).__init__(*args, **kwargs)
self.fields['field_name'].queryset = self.instance.field_name
But this will require manual setting on every form. Is it possible to extend the ModelMultipleChoiceField to get the queryset from the field choices? I think that I need to extend ModelChoiceIterator but couldn't understand how to access the module instance.
Thanks