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')