Opened 8 years ago

Closed 8 years ago

#4085 closed (worksforme)

Admin list_filter not working with foreignkey field

Reported by: jober@… Owned by: nobody
Component: Core (Management commands) Version: 0.96
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a model that uses this field:

item = models.ForeignKey(Item, validator_list=[item_available])

In the same model's Admin class, I have:

list_filter = ['item', 'foo', 'bar']

In the admin filter panel, fields foo and bar display as filters, but item does not. If I remove all other fields from list_filter, the foreignkey field still does not display; it displays no filters at all.

Change History (3)

comment:1 follow-up: Changed 8 years ago by Yaggo

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

Confirm this bug with SVN revision 5468 (2007-06-13).

comment:2 in reply to: ↑ 1 Changed 8 years ago by anonymous

Replying to Yaggo:

Confirm this bug with SVN revision 5468 (2007-06-13).

I cancel my confirmation - list_filter _does_ work with ForeignKeys, but the filter won't be displayed unless there are more than one choices available.

comment:3 Changed 8 years ago by SmileyChris

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

Pretty sure this works for me too. Feel free to reopen if you can provide more details.

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