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

Add shortcut and order

This commit is contained in:
Alexandre Iooss
2019-08-11 18:37:04 +02:00
parent d08ac181c9
commit 7d94609f9b
4 changed files with 138 additions and 1 deletions

View File

@ -18,6 +18,7 @@ class Auteur(models.Model):
class Meta:
verbose_name = _("author")
verbose_name_plural = _("authors")
ordering = ['nom']
class Media(models.Model):
@ -62,11 +63,13 @@ class Media(models.Model):
)
def __str__(self):
return str(self.title) + ' - ' + str(self.authors.all().first())
return str(self.title) + ' - ' + str(self.subtitle) \
+ ' - ' + str(self.authors.all().first())
class Meta:
verbose_name = _("medium")
verbose_name_plural = _("media")
ordering = ['title', 'subtitle']
class Emprunt(models.Model):
@ -97,6 +100,7 @@ class Emprunt(models.Model):
class Meta:
verbose_name = _("borrowed item")
verbose_name_plural = _("borrowed items")
ordering = ['-date_emprunt']
class Jeu(models.Model):
@ -122,3 +126,4 @@ class Jeu(models.Model):
class Meta:
verbose_name = _("game")
verbose_name_plural = _("games")
ordering = ['nom']