From 56f8937ba999e49d91df44b987264401f68dc49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Cormier=20=28=C3=89rudit=29?= Date: Fri, 2 Sep 2016 10:09:57 -0400 Subject: [PATCH] admin: add search_fields to InstitutionIPAddressRange --- eruditorg/core/subscription/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eruditorg/core/subscription/admin.py b/eruditorg/core/subscription/admin.py index b9acc5e75..1013219e6 100644 --- a/eruditorg/core/subscription/admin.py +++ b/eruditorg/core/subscription/admin.py @@ -15,6 +15,10 @@ class JournalAccessSubscriptionPeriodInline(admin.TabularInline): model = JournalAccessSubscriptionPeriod +class InstitutionIPAddressRangeAdmin(admin.ModelAdmin): + search_fields = ('subscription__organisation__name',) + + class JournalAccessSubscriptionAdmin(admin.ModelAdmin): fieldsets = [ (None, { @@ -28,6 +32,7 @@ class JournalAccessSubscriptionAdmin(admin.ModelAdmin): }), ] + search_fields = ('organisation__name',) inlines = [JournalAccessSubscriptionPeriodInline, ] list_display = ('pk', 'title', 'user', 'organisation', 'journal', 'collection', 'full_access', ) @@ -44,7 +49,7 @@ class JournalManagementSubscriptionAdmin(admin.ModelAdmin): list_display_links = ('pk', 'title', 'journal', ) -admin.site.register(InstitutionIPAddressRange) +admin.site.register(InstitutionIPAddressRange, InstitutionIPAddressRangeAdmin) admin.site.register(JournalAccessSubscription, JournalAccessSubscriptionAdmin) admin.site.register(JournalAccessSubscriptionPeriod) admin.site.register(JournalManagementPlan, JournalManagementPlanAdmin)