From ea6e7a14720f05ed51d6b4ed7b0dfee8a38c1807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 15 Jul 2016 20:01:45 +0200 Subject: [PATCH] =?UTF-8?q?Ajoute=20des=20fonctions=20`=5F=5Fstr=5F=5F`=20?= =?UTF-8?q?l=C3=A0=20o=C3=B9=20=C3=A7a=20manque?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bda/models.py | 7 ++++++- gestioncof/models.py | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bda/models.py b/bda/models.py index 46b90b99..41037643 100644 --- a/bda/models.py +++ b/bda/models.py @@ -133,7 +133,7 @@ class Participant(models.Model): tirage = models.ForeignKey(Tirage) def __str__(self): - return "%s" % (self.user) + return "%s - %s" % (self.user, self.tirage.title) DOUBLE_CHOICES = ( ("1", "1 place"), @@ -159,6 +159,11 @@ class ChoixSpectacle(models.Model): return self.double_choice == "autoquit" autoquit = property(get_autoquit) + def __str__(self): + return "Vœux de %s pour %s" % ( + self.participant.user.get_full_name, + self.spectacle.title) + class Meta: ordering = ("priority",) unique_together = (("participant", "spectacle",),) diff --git a/gestioncof/models.py b/gestioncof/models.py index 8d660a53..cf3742f1 100644 --- a/gestioncof/models.py +++ b/gestioncof/models.py @@ -89,6 +89,9 @@ class Club(models.Model): respos = models.ManyToManyField(User, related_name="clubs_geres") membres = models.ManyToManyField(User, related_name="clubs") + def __str__(self): + return self.name + @python_2_unicode_compatible class CustomMail(models.Model): @@ -148,6 +151,9 @@ class EventCommentValue(models.Model): related_name="comments") content = models.TextField("Contenu", blank=True, null=True) + def __str__(self): + return "Commentaire de %s" % self.commentfield + @python_2_unicode_compatible class EventOption(models.Model): @@ -243,8 +249,16 @@ class SurveyAnswer(models.Model): verbose_name = "Réponses" unique_together = ("user", "survey") + def __str__(self): + return "Réponse de %s sondage %s" % ( + self.user.get_full_name(), + self.survey.title) + @python_2_unicode_compatible class Clipper(models.Model): username = models.CharField("Identifiant", max_length=20) fullname = models.CharField("Nom complet", max_length=200) + + def __str__(self): + return "Clipper %s" % self.username