Opened 10 years ago

Closed 10 years ago

#1592 closed defect (invalid)

[patch] ReverseSingleRelatedObjectDescriptor should use limit_choices_to

Reported by: mir@… Owned by: adrian
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: UI/UX:


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@… 10 years ago.

Download all attachments as: .zip

Change History (3)

Changed 10 years ago by mir@…


comment:2 Changed 10 years ago by lukeplant

  • Resolution set to invalid
  • Status changed from new to 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).

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