Skip to content

queryset from choices #540

@predatell

Description

@predatell

I want to use ModelSelect2Widget with ModelChoiceField. I set queryset to ModelChoiceField, so I don't want to add the same queryset to ModelSelect2Widget. ModelSelect2Widget can take it from self.choices.queryset(related pull request #509). Example how do I use it:

item = forms.ModelChoiceField(queryset=MyModel.objects.filter(is_active=True), required=False, widget=ModelSelect2Widget)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions