Admin page changes to get the name and search fields.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Sat, 12 Dec 2009 03:18:18 +0530
changeset 65 282cd6aa9fd8
parent 64 af5a8b6cbe4b
child 66 fdcf8ee37f4e
Admin page changes to get the name and search fields.
project/kiwipycon/registration/admin.py
--- a/project/kiwipycon/registration/admin.py	Sat Dec 12 03:04:07 2009 +0530
+++ b/project/kiwipycon/registration/admin.py	Sat Dec 12 03:18:18 2009 +0530
@@ -9,7 +9,7 @@
 from .models import Wifi
 
 class RegistrationAdmin(admin.ModelAdmin):
-    list_display = ('registrant', 'slug', 'email', 'city', 
+    list_display = ('registrant', 'full_name', 'slug', 'email', 'city', 
             'organisation', 'occupation', 'postcode',
             'tshirt', 'conference', 'tutorial', 'sprint',
             'allow_contact')
@@ -23,9 +23,13 @@
         }),
     )
 
+    search_fields = ['registrant__username', 'registrant__email']
+
     def email(self, obj):
         return obj.registrant.email
 
+    def full_name(self, obj):
+        return obj.registrant.get_full_name()
 
 admin.site.register(Registration, RegistrationAdmin)