From bb47ad97a33d6f6814beacb4610e3efb16182f97 Mon Sep 17 00:00:00 2001 From: Krophil Date: Fri, 17 Nov 2017 11:48:16 +0100 Subject: [PATCH] Search field in Subscription admin area --- subscription/admin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/subscription/admin.py b/subscription/admin.py index 985a0691..16e2be40 100644 --- a/subscription/admin.py +++ b/subscription/admin.py @@ -25,5 +25,11 @@ from django.contrib import admin from subscription.models import Subscription +from haystack.admin import SearchModelAdmin -admin.site.register(Subscription) + +class SubscriptionAdmin(SearchModelAdmin): + search_fields = ["member__username", "subscription_start", "subscription_end", "subscription_type"] + + +admin.site.register(Subscription, SubscriptionAdmin)