From f0aa02eeb47cd18243a68375126a9476d4d64db8 Mon Sep 17 00:00:00 2001 From: nanoy Date: Sun, 23 Dec 2018 21:48:49 +0100 Subject: [PATCH] Add search bar on profile admin --- users/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/users/admin.py b/users/admin.py index e36d04f..c3737f8 100644 --- a/users/admin.py +++ b/users/admin.py @@ -4,7 +4,10 @@ from simple_history.admin import SimpleHistoryAdmin from .models import School, Profile, CotisationHistory +class ProfileAdmin(SimpleHistoryAdmin): + search_fields = ('user__username', 'user__first_name', 'user__last_name') + admin.site.register(Permission, SimpleHistoryAdmin) admin.site.register(School, SimpleHistoryAdmin) -admin.site.register(Profile, SimpleHistoryAdmin) +admin.site.register(Profile, ProfileAdmin) admin.site.register(CotisationHistory, SimpleHistoryAdmin) \ No newline at end of file