Opened 14 years ago

Closed 14 years ago

#15104 closed (worksforme)

Django 1.2.4 removes support for lookups that span relationships in limit_choices_to

Reported by: Niran Babalola Owned by: nobody
Component: Uncategorized Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django 1.2.4 requires fields listed in limit_choices_to to be present in list_filters, but the latter doesn't support lookups that span relationships. A FieldDoesNotExist exception is raised by db.models.Options.get_field when the admin is trying to display the filter in the sidebar of the list view in admin.views.main.ChangeList.get_filters.

Change History (2)

comment:1 by Ramiro Morales, 14 years ago

list_filters supports lookups that span relationships but there have been a couple of bug fixed since 1.2.4 got released. I'd like to ask you for two things:

  • Please test with a recent checkout of the releases/1.2.X SVN branch and verify if the issue you are seeing is still present.
  • Please clarify, if it is with a concrete, simple example it would be great, the situation you report. It is not clear to me if the spaning over relationships is needed in the ModelAdmin of the model declaring the relationship or in the one of the model that is the target of the relationship (the one shown in the limit_choices_to popup, the limit_choices_to dictionary can accept lookups that span relatinships).

I won't accept nor close the ticket, leaving it subject to your feedback.

comment:2 by Niran Babalola, 14 years ago

Resolution: worksforme
Status: newclosed

You're correct. Thanks.

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