Opened 13 years ago

Closed 12 years ago

#2718 closed defect (duplicate)

filters in auth.models not visible in admin-interface

Reported by: patrick@… Owned by: Adrian Holovaty
Component: contrib.admin Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


filters defined in auth.models User don´t show up in admin-interface

Change History (8)

comment:1 Changed 13 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

Please reopen this with more information; I'm not sure what you mean.

comment:2 Changed 13 years ago by patrick@…

Resolution: invalid
Status: closedreopened

in auth.models User:
list_filter = ('is_staff', 'is_superuser', 'is_active')

none of these filters show up in the admin-interface. I´m on the latest revision.
I have filters in other models and they work fine.

comment:3 Changed 13 years ago by Adrian Holovaty

Resolution: worksforme
Status: reopenedclosed

Works for me...I'm not sure why it wouldn't be working for you. Maybe try a fresh installation?

comment:4 Changed 13 years ago by patrick@…

just did a fresh installation. however, it´s not that important. btw, I´m using OneToOne for extending the user with a user-profile. not sure if that can cause the problem.

comment:5 Changed 13 years ago by patrick@…

Resolution: worksforme
Status: closedreopened

when you extend the user with a one-to-one userprofile, the filters don´t show up anymore (using the revision 3896)

comment:6 Changed 13 years ago by Honza Král <Honza.Kral@…>

This problem still exists. Even if I don't have a OneToOne field, I still cannot filter using some foreign keys. If I apply following patch, it works well.

  • django/contrib/admin/views/

    574574    def get_filters(self, request):
    575575        filter_specs = []
    576         if self.lookup_opts.admin.list_filter and not self.opts.one_to_one_field:
     576        if self.lookup_opts.admin.list_filter:
    577577            filter_fields = [self.lookup_opts.get_field(field_name) \
    578578                              for field_name in self.lookup_opts.admin.list_filter]
    579579            for f in filter_fields:

The other peculiar thing is that when I try and construct an instance of the model from the interactive shell, ._meta.one_to_one_field is None and the condition should not affect it... I somebody can tell me where to look, if not I can try and digg it out myself.

comment:7 Changed 12 years ago by alex@…

Same for me. Suddenly all my filters disappeared and I did not realized that was because I've used
OneToOne field. Thank you for this patch! :)

comment:8 Changed 12 years ago by anonymous

Resolution: duplicate
Status: reopenedclosed

I believe this is duplicate to ticket:2145. Ticket:2145 provides same solution in same place for the same problem.

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