Opened 19 years ago
Closed 19 years ago
#1592 closed defect (invalid)
[patch] ReverseSingleRelatedObjectDescriptor should use limit_choices_to
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | magic-removal |
Severity: | normal | Keywords: | ForeignKey limit_choices_to |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have defined a ForeignKey with limit_choices_to for say "somefield".
Now, when I do:
someobject.somefield
the resulting query to the related object does not use this limitation. Shouldn't it do this?
I'm not absolutely sure on this, though, but would be very interested in the reasons if I'm wrong.
Attachments (1)
Change History (3)
by , 19 years ago
Attachment: | related_with_limit_choices.diff added |
---|
comment:2 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
limit_choices_to only affects what you see in the admin, as per the docs. If you want this kind of functionality, use a custom default manager (there are examples in the tests at least).
patch