From b6655047ed8791cbe467b2a2b5033b1ac42fab87 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 5 Sep 2016 03:10:06 +0200 Subject: [PATCH] verbose names --- bda/admin.py | 11 ++++------- bda/models.py | 9 +++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index b604d65b..37fdf9c7 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -216,16 +216,13 @@ class SpectacleReventeAdmin(admin.ModelAdmin): def spectacle(self, obj): return obj.attribution.spectacle - def participant(self, obj): - return obj.attribution.participant - - list_display = ("spectacle", "participant", "date", "soldTo") + list_display = ("spectacle", "seller", "date", "soldTo") raw_id_fields = ("attribution",) readonly_fields = ("shotgun", "expiration_time") search_fields = ("spectacle__title", - "participant__user__username", - "participant__user__firstname", - "participant__user__lastname",) + "seller__user__username", + "seller__user__firstname", + "seller__user__lastname",) admin.site.register(CategorieSpectacle) diff --git a/bda/models.py b/bda/models.py index 428dbfb7..baed138e 100644 --- a/bda/models.py +++ b/bda/models.py @@ -222,8 +222,10 @@ class SpectacleRevente(models.Model): related_name="wanted", blank=True) seller = models.ForeignKey(Participant, - related_name="original_shows") - soldTo = models.ForeignKey(Participant, blank=True, null=True) + related_name="original_shows", + verbose_name="Vendeur") + soldTo = models.ForeignKey(Participant, blank=True, null=True, + verbose_name="Vendue à") def get_expiration_time(self): remaining_time = (self.attribution.spectacle.date - self.date) @@ -240,6 +242,9 @@ class SpectacleRevente(models.Model): return "%s -- %s" % (self.seller, self.attribution.spectacle.title) + class Meta: + verbose_name = "Revente" + def send_notif(self): # On récupère la liste des inscrits inscrits = self.attribution.spectacle.revente.select_related('user')