Verified Commit 07c21b9c authored by erdnaxe's avatar erdnaxe 🎇

Add subtitle to admin

parent 7d94609f
Pipeline #1430 failed with stage
in 3 minutes and 23 seconds
......@@ -18,7 +18,7 @@ class AuteurAdmin(VersionAdmin):
class MediaAdmin(VersionAdmin):
list_display = ('title', 'authors_list', 'side_identifier', 'isbn',
list_display = ('full_name', 'authors_list', 'side_identifier', 'isbn',
search_fields = ('title', 'authors__nom', 'side_identifier', 'subtitle',
......@@ -26,6 +26,14 @@ class MediaAdmin(VersionAdmin):
date_hierarchy = 'publish_date'
form = MediaAdminForm
def full_name(self, obj):
if obj.subtitle:
return "{} : {}".format(obj.title, obj.subtitle)
return obj.title
full_name.short_description = _('name')
def authors_list(self, obj):
return ", ".join([a.nom for a in obj.authors.all()])
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment