From 6da84dd3bd88ef3918a2f1367627c0d1faac340c Mon Sep 17 00:00:00 2001 From: koksnuss Date: Fri, 22 May 2020 01:07:21 +0200 Subject: [PATCH] make admin coins searchable --- coinmanager/coinc/admin.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coinmanager/coinc/admin.py b/coinmanager/coinc/admin.py index 8afb371..9a6936c 100644 --- a/coinmanager/coinc/admin.py +++ b/coinmanager/coinc/admin.py @@ -23,7 +23,12 @@ from django.contrib import admin from .models import User, Coin, Country, Stamp +class CoinAdmin(admin.ModelAdmin): + list_display = ('value', 'year', 'country', 'stamp', 'name', 'found_by', 'found_on') + list_filter = ('value', 'year', 'country', 'stamp', 'found_by') + search_fields = ['name'] + admin.site.register(User) -admin.site.register(Coin) +admin.site.register(Coin, CoinAdmin) admin.site.register(Country) admin.site.register(Stamp)