Admin page changes to get the name and search fields.
--- 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)