ModelForm fields for RelatedFields should use limit_choices_to
|Reported by:||Daniel Pope <dan@…>||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The limit_choices_to property for ForeignKey, ManyToManyField etc currently only affects the admin page for the model. It does not currently limit choices for the ModelChoiceField/MultipleModelChoiceField when using ModelForm.
I find this slightly misleading to read, and inconvenient to use, as I would like to use limit_choices_to to place a constraint on the data across the board, not just in the admin screen.
Change History (3)
comment:1 Changed 8 years ago by brosner
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Resolution set to duplicate
- Status changed from new to closed