Commits

Luke Plant  committed 45f1e9b

Improved admin interface for contacts

  • Participants
  • Parent commits 67d23a4

Comments (0)

Files changed (1)

File contacts/admin.py

 
 class ContactAdmin(admin.ModelAdmin):
     def address(obj):
-        return obj.address.replace('\n', ', ')
-    list_display = ['name', address, 'post_code', 'phone_number', 'mobile_number', 'email', 'church_member', ]
+        lines = obj.address.split('\n')
+        return lines[0] + u'...' if len(lines) > 1 else u''
+    list_display = ['name', address, 'post_code', 'phone_number', 'mobile_number', 'email', 'church_member', 'home_group']
     list_filter = ['church_member', 'home_group']