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