From 6747567bc1973ebd84cf89bab4643fc8e2a88d7f Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Thu, 31 Oct 2024 16:57:41 +0000 Subject: [PATCH] Allow sorting and filtering by Profile.date_joined in Django admin --- RIGS/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RIGS/admin.py b/RIGS/admin.py index bf08421d..375594bc 100644 --- a/RIGS/admin.py +++ b/RIGS/admin.py @@ -154,9 +154,9 @@ class Meta: @admin.register(models.Profile) class ProfileAdmin(UserAdmin, AssociateAdmin): - list_display = ('username', 'name', 'is_approved', 'is_superuser', 'is_supervisor', 'number_of_events', 'last_login') + list_display = ('username', 'name', 'is_approved', 'is_superuser', 'is_supervisor', 'number_of_events', 'last_login', 'date_joined') list_display_links = ['username'] - list_filter = UserAdmin.list_filter + ('is_approved',) + list_filter = UserAdmin.list_filter + ('is_approved', 'date_joined') fieldsets = ( (None, {'fields': ('username', 'password')}), (_('Personal info'), {