Opened 11 years ago

Closed 10 years ago

#22396 closed Bug (needsinfo)

Admin AllValuesFieldListFilter not respecting ModelAdmin.get_queryset

Reported by: serialx.net@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Admin's AllValuesFieldListFilter object does not respect ModelAdmin.get_queryset. Instead it mysteriously calls reverse_field_path() method and uses the _default_manager to get the queryset.

It causes problems when the default database has no table for the model, and only the other databases has the table. It causes "Table not found" query error message.

Pull request: https://github.com/django/django/pull/2522

Change History (2)

comment:1 by Tim Graham, 11 years ago

Easy pickings: unset

Could you add a test to demonstrate the problem?

comment:2 by Tim Graham, 10 years ago

Resolution: needsinfo
Status: newclosed

The proposed patch breaks some admin_view tests. Please reopen if you can provide more details and a patch that doesn't break tests. Thanks!

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