From 429736f7e9fcdc92ea43f98e3a246b9e41e04707 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 27 Nov 2013 17:05:02 -0500 Subject: Remove date_hierarchy from several package admin views I was never using this and it adds some pretty substantial overhead to each render of the admin page, so toss it. Add the simple date filter to the sidebar instead. Signed-off-by: Dan McGee --- packages/admin.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/admin.py b/packages/admin.py index 4680c75..5df0043 100644 --- a/packages/admin.py +++ b/packages/admin.py @@ -15,10 +15,9 @@ class PackageRelationAdmin(admin.ModelAdmin): class FlagRequestAdmin(admin.ModelAdmin): list_display = ('pkgbase', 'full_version', 'repo', 'created', 'who', 'is_spam', 'is_legitimate', 'message') - list_filter = ('is_spam', 'is_legitimate', 'repo') + list_filter = ('is_spam', 'is_legitimate', 'repo', 'created') search_fields = ('pkgbase', 'user_email', 'message') ordering = ('-created',) - date_hierarchy = 'created' def get_queryset(self, request): qs = super(FlagRequestAdmin, self).queryset(request) @@ -28,19 +27,17 @@ class FlagRequestAdmin(admin.ModelAdmin): class SignoffAdmin(admin.ModelAdmin): list_display = ('pkgbase', 'full_version', 'arch', 'repo', 'user', 'created', 'revoked') - list_filter = ('arch', 'repo', 'user') + list_filter = ('arch', 'repo', 'user', 'created') search_fields = ('pkgbase', 'user__username') ordering = ('-created',) - date_hierarchy = 'created' class SignoffSpecificationAdmin(admin.ModelAdmin): list_display = ('pkgbase', 'full_version', 'arch', 'repo', 'user', 'created', 'comments') - list_filter = ('arch', 'repo', 'user') + list_filter = ('arch', 'repo', 'user', 'created') search_fields = ('pkgbase', 'user__username') ordering = ('-created',) - date_hierarchy = 'created' def get_queryset(self, request): qs = super(SignoffSpecificationAdmin, self).queryset(request) @@ -50,10 +47,9 @@ class SignoffSpecificationAdmin(admin.ModelAdmin): class UpdateAdmin(admin.ModelAdmin): list_display = ('pkgname', 'repo', 'arch', 'action_flag', 'old_version', 'new_version', 'created') - list_filter = ('action_flag', 'repo', 'arch') + list_filter = ('action_flag', 'repo', 'arch', 'created') search_fields = ('pkgname',) ordering = ('-created',) - date_hierarchy = 'created' raw_id_fields = ('package',) -- cgit v1.2.3-24-g4f1b