#22396 closed Bug (needsinfo)

Admin AllValuesFieldListFilter not respecting ModelAdmin.get_queryset

Reported by: serialx.net@… Owned by: nobody
Component: contrib.admin Version: master
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 Changed 17 months ago by timo

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Could you add a test to demonstrate the problem?

comment:2 Changed 16 months ago by timo

  • Resolution set to needsinfo
  • Status changed from new to closed

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