search in confirmation and contact admins
authorJan Szejko <janek37@gmail.com>
Fri, 17 Nov 2017 15:47:18 +0000 (16:47 +0100)
committerJan Szejko <janek37@gmail.com>
Fri, 17 Nov 2017 15:47:18 +0000 (16:47 +0100)
contact/admin.py
wtem/admin.py

index 22d3593..437ad97 100644 (file)
@@ -28,6 +28,7 @@ class ContactAdmin(admin.ModelAdmin):
     fields = ['form_tag', 'created_at', 'contact', 'ip']
     readonly_fields = ['form_tag', 'created_at', 'contact', 'ip']
     list_filter = ['form_tag']
     fields = ['form_tag', 'created_at', 'contact', 'ip']
     readonly_fields = ['form_tag', 'created_at', 'contact', 'ip']
     list_filter = ['form_tag']
+    search_fields = ['contact', 'body']
 
     @staticmethod
     def admin_list(obj, nr):
 
     @staticmethod
     def admin_list(obj, nr):
index efaf253..acab816 100644 (file)
@@ -244,6 +244,7 @@ class ConfirmationAdmin(admin.ModelAdmin):
     readonly_fields = ('contact', 'readable_contact', 'readable_age', 'school_phone', 'key', 'confirmed')
     list_filter = ('confirmed',)
     list_select_related = ('contact',)
     readonly_fields = ('contact', 'readable_contact', 'readable_age', 'school_phone', 'key', 'confirmed')
     list_filter = ('confirmed',)
     list_select_related = ('contact',)
+    search_fields = ('last_name', 'email', 'contact__contact')
 
     def resend_mail(self, request, queryset):
         for confirmation in queryset:
 
     def resend_mail(self, request, queryset):
         for confirmation in queryset: