mirror of
https://gitlab.crans.org/mediatek/med.git
synced 2024-11-27 11:33:03 +00:00
Keep displaying models in Django-Admin main menu
This commit is contained in:
parent
e3bab2389c
commit
54f8198b86
@ -23,6 +23,7 @@ class AuthorAdmin(VersionAdmin):
|
||||
class BorrowableAdmin(PolymorphicParentModelAdmin):
|
||||
search_fields = ('title',)
|
||||
child_models = (CD, Comic, Manga, Novel, Review, Vinyl,)
|
||||
show_in_index = False
|
||||
|
||||
|
||||
class MediumAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
@ -33,6 +34,7 @@ class MediumAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
autocomplete_fields = ('authors',)
|
||||
date_hierarchy = 'publish_date'
|
||||
form = MediaAdminForm
|
||||
show_in_index = True
|
||||
|
||||
def authors_list(self, obj):
|
||||
return ", ".join([a.name for a in obj.authors.all()])
|
||||
@ -88,6 +90,7 @@ class CDAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
list_display = ('title', 'authors_list', 'side_identifier',)
|
||||
search_fields = ('title', 'authors__name', 'side_identifier',)
|
||||
autocomplete_fields = ('authors',)
|
||||
show_in_index = True
|
||||
|
||||
def authors_list(self, obj):
|
||||
return ", ".join([a.name for a in obj.authors.all()])
|
||||
@ -99,6 +102,7 @@ class VinylAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
list_display = ('title', 'authors_list', 'side_identifier', 'rpm',)
|
||||
search_fields = ('title', 'authors__name', 'side_identifier', 'rpm',)
|
||||
autocomplete_fields = ('authors',)
|
||||
show_in_index = True
|
||||
|
||||
def authors_list(self, obj):
|
||||
return ", ".join([a.name for a in obj.authors.all()])
|
||||
@ -109,6 +113,7 @@ class VinylAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
class ReviewAdmin(VersionAdmin, PolymorphicChildModelAdmin):
|
||||
list_display = ('__str__', 'number', 'year', 'month', 'day', 'double',)
|
||||
search_fields = ('title', 'number', 'year',)
|
||||
show_in_index = True
|
||||
|
||||
|
||||
class EmpruntAdmin(VersionAdmin):
|
||||
|
Loading…
Reference in New Issue
Block a user