Opened 18 years ago

Closed 18 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

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)

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

Download all attachments as: .zip

Change History (3)

by mir@…, 18 years ago

patch

comment:2 by Luke Plant, 18 years ago

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