Allow professional services to be searchable in the admin
authorJonathan S. Katz <jonathan.katz@excoventures.com>
Wed, 30 Apr 2014 12:13:37 +0000 (08:13 -0400)
committerJonathan S. Katz <jonathan.katz@excoventures.com>
Wed, 30 Apr 2014 12:13:37 +0000 (08:13 -0400)
Enables an admin to search over professional services, and additionally
filter the services by whether or not they are approved.

pgweb/profserv/admin.py

index 8cae2fbb348be2f7007dd023469dd80ce14cd6d6..ef7405d8fb7e0b41f033bed0adbb61e303140708 100644 (file)
@@ -1,4 +1,11 @@
-from util.admin import register_pgwebadmin
+from django.contrib import admin
+
+from util.admin import PgwebAdmin
 from models import ProfessionalService
 
-register_pgwebadmin(ProfessionalService)
+class ProfessionalServiceAdmin(PgwebAdmin):
+       list_display = ('__unicode__', 'approved',)
+       list_filter = ('approved',)
+       search_fields = ('org__name',)
+
+admin.site.register(ProfessionalService, ProfessionalServiceAdmin)