forked from DGNum/gestioCOF
verbose names
This commit is contained in:
parent
de522a0035
commit
b6655047ed
2 changed files with 11 additions and 9 deletions
11
bda/admin.py
11
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)
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue