From 4d7b48f8b865f7e4dcfe2b790d2723f48d6b6530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benni=20B=C3=A4rmann?= Date: Fri, 2 Dec 2022 16:04:11 +0000 Subject: [PATCH] admin search bar working now for all models, gave a 500 error because of wrong syntax in admin.py - searchfields --- input/admin.py | 12 ++++++------ input/models.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/input/admin.py b/input/admin.py index eff2e5e..20db719 100755 --- a/input/admin.py +++ b/input/admin.py @@ -38,7 +38,7 @@ class ProjectAdmin(admin.ModelAdmin): @admin.register(BusinessCard) class BusinessCardAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date', 'project') + search_fields = ('realname', 'service_id', 'granted', 'granted_date', 'project') list_display = ('realname', 'service_id', 'granted', 'granted_date', 'project') list_display_links = ('realname', 'service_id') # action = ['export_as_csv'] @@ -49,7 +49,7 @@ class BusinessCardAdmin(admin.ModelAdmin): @admin.register(Literature) class LiteratureAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date') + search_fields = ('realname', 'service_id', 'granted', 'granted_date') list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' @@ -73,7 +73,7 @@ class HonoraryCertificateAdmin(admin.ModelAdmin): @admin.register(Library) class LibraryAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date') + search_fields = ('realname', 'service_id', 'granted', 'granted_date') list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' @@ -81,7 +81,7 @@ class LibraryAdmin(admin.ModelAdmin): @admin.register(IFG) class IFGAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date') + search_fields = ('realname', 'service_id', 'granted', 'granted_date') list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' @@ -97,7 +97,7 @@ class TravelAdmin(admin.ModelAdmin): @admin.register(Email) class EmailAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date') + search_fields = ('realname', 'service_id', 'granted', 'granted_date') list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' @@ -106,7 +106,7 @@ class EmailAdmin(admin.ModelAdmin): @admin.register(List) class ListAdmin(admin.ModelAdmin): save_as = True - search_fields = (('realname', 'service_id'), 'granted', 'granted_date') + search_fields = ('realname', 'service_id', 'granted', 'granted_date') list_display = ('realname', 'service_id', 'granted', 'granted_date') list_display_links = ('realname', 'service_id') date_hierarchy = 'granted_date' diff --git a/input/models.py b/input/models.py index f5ced02..a302bd3 100755 --- a/input/models.py +++ b/input/models.py @@ -124,7 +124,7 @@ class Project(Volunteer): class Intern(Volunteer): - '''abstrat base class for data entry from /intern (except Project)''' + '''abstract base class for data entry from /intern (except Project)''' request_url = models.URLField(max_length=2000, verbose_name='Antrag (URL)') intern_notes = models.TextField(max_length=1000, blank=True) class Meta: