From b2ed245dcfeceba9a1b9fd6ca24acc2661c3ef3f Mon Sep 17 00:00:00 2001 From: PCoder Date: Mon, 11 Oct 2021 08:23:22 +0530 Subject: [PATCH] Make Resource, Range and Field fields searchable --- app/admin.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/admin.py b/app/admin.py index 8b1662a..c4e7a02 100644 --- a/app/admin.py +++ b/app/admin.py @@ -6,11 +6,23 @@ class PersonAdmin(admin.ModelAdmin): search_fields = ['title', 'first_name', 'last_name', 'organisation', 'position', 'country', 'contact_email'] +class ResourceAdmin(admin.ModelAdmin): + search_fields = ['title', 'url', 'citation', 'abstract'] + + +class RangeAdmin(admin.ModelAdmin): + search_fields = ['name', 'countries'] + + +class FieldAdmin(admin.ModelAdmin): + search_fields = ['name'] + + # Register your models here. admin.site.register(Person, PersonAdmin) -admin.site.register(Resource) -admin.site.register(Range) +admin.site.register(Resource, ResourceAdmin) +admin.site.register(Range, RangeAdmin) admin.site.register(Method) admin.site.register(Scale) admin.site.register(Taxon) -admin.site.register(Field) +admin.site.register(Field, FieldAdmin)