#12582 closed (fixed)
Model validation of ForeignKeys ignore limit_choices_to
| Reported by: | Honza Král | Owned by: | Honza Král |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | validation limit choices foreign keys | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When checking valida value of a FK field:
self.rel.to._default_manager.get(**{self.rel.field_name:value})
is used instead of more efficient .exists() and limit_choices_to option is ignored
Attachments (1)
Change History (5)
comment:1 by , 16 years ago
| Needs tests: | set |
|---|---|
| Status: | new → assigned |
| Triage Stage: | Unreviewed → Accepted |
by , 16 years ago
| Attachment: | 12582.diff added |
|---|
comment:2 by , 16 years ago
| Needs tests: | unset |
|---|
comment:3 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
(In [12271]) Fixed #12582. Model validation on ForeignKeys now respects limit_choices_to. Thanks, Honza Král.