Browse Source

admin search bar working now for all models, gave a 500 error because of wrong syntax in admin.py - searchfields

master
Benni Bärmann 2 years ago
parent
commit
4d7b48f8b8
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      input/admin.py
  2. +1
    -1
      input/models.py

+ 6
- 6
input/admin.py View File

@ -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'

+ 1
- 1
input/models.py View File

@ -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:

Loading…
Cancel
Save