Ajoute des fonctions __str__ là où ça manque

This commit is contained in:
Martin Pépin 2016-07-15 20:01:45 +02:00
parent 4d27d85384
commit ea6e7a1472
2 changed files with 20 additions and 1 deletions

View file

@ -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",),)

View file

@ -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