1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-06 00:03:56 +02:00

Use media str method for admin

This commit is contained in:
Alexandre Iooss
2019-08-15 11:37:10 +02:00
parent 04c00fd5d0
commit 626990b119
2 changed files with 5 additions and 11 deletions

View File

@ -63,8 +63,10 @@ class Media(models.Model):
)
def __str__(self):
return str(self.title) + ' - ' + str(self.subtitle) \
+ ' - ' + str(self.authors.all().first())
if self.subtitle:
return "{} : {}".format(self.title, self.subtitle)
else:
return self.title
class Meta:
verbose_name = _("medium")