Opened 17 years ago

Closed 17 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: no UI/UX: no

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 by Yaggo, 17 years ago

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

in reply to:  1 comment:2 by anonymous, 17 years ago

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 by Chris Beaven, 17 years ago

Resolution: worksforme
Status: newclosed

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