Opened 13 years ago

Closed 13 years ago

#1592 closed defect (invalid)

[patch] ReverseSingleRelatedObjectDescriptor should use limit_choices_to

Reported by: mir@… 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


I have defined a ForeignKey with limit_choices_to for say "somefield".
Now, when I do:


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)

related_with_limit_choices.diff (578 bytes) - added by mir@… 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by mir@…


comment:2 Changed 13 years ago by Luke Plant

Resolution: invalid
Status: newclosed

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).

Note: See TracTickets for help on using tickets.
Back to Top