Opened 18 years ago

Closed 17 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: dev
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

Description

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

Change History (8)

comment:1 by Adrian Holovaty, 18 years ago

Resolution: invalid
Status: newclosed

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

comment:2 by patrick@…, 18 years ago

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 by Adrian Holovaty, 18 years ago

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 by patrick@…, 18 years ago

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 by patrick@…, 17 years ago

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 by Honza Král <Honza.Kral@…>, 17 years ago

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/main.py

     
    573573
    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 by alex@…, 17 years ago

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

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