Merge branch 'Kerl/bda_models_update' into 'master'

Typo et suppression de la py2 compat



See merge request !150
This commit is contained in:
Martin Pepin 2017-01-25 23:58:23 +01:00
commit c2b74ea625

View file

@ -11,10 +11,8 @@ from django.template import loader
from django.core import mail from django.core import mail
from django.conf import settings from django.conf import settings
from django.utils import timezone, formats from django.utils import timezone, formats
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Tirage(models.Model): class Tirage(models.Model):
title = models.CharField("Titre", max_length=300) title = models.CharField("Titre", max_length=300)
ouverture = models.DateTimeField("Date et heure d'ouverture du tirage") ouverture = models.DateTimeField("Date et heure d'ouverture du tirage")
@ -29,7 +27,6 @@ class Tirage(models.Model):
timezone.template_localtime(self.fermeture))) timezone.template_localtime(self.fermeture)))
@python_2_unicode_compatible
class Salle(models.Model): class Salle(models.Model):
name = models.CharField("Nom", max_length=300) name = models.CharField("Nom", max_length=300)
address = models.TextField("Adresse") address = models.TextField("Adresse")
@ -38,7 +35,6 @@ class Salle(models.Model):
return self.name return self.name
@python_2_unicode_compatible
class CategorieSpectacle(models.Model): class CategorieSpectacle(models.Model):
name = models.CharField('Nom', max_length=100, unique=True) name = models.CharField('Nom', max_length=100, unique=True)
@ -137,7 +133,6 @@ PAYMENT_TYPES = (
) )
@python_2_unicode_compatible
class Participant(models.Model): class Participant(models.Model):
user = models.ForeignKey(User) user = models.ForeignKey(User)
choices = models.ManyToManyField(Spectacle, choices = models.ManyToManyField(Spectacle,
@ -165,7 +160,6 @@ DOUBLE_CHOICES = (
) )
@python_2_unicode_compatible
class ChoixSpectacle(models.Model): class ChoixSpectacle(models.Model):
participant = models.ForeignKey(Participant) participant = models.ForeignKey(Participant)
spectacle = models.ForeignKey(Spectacle, related_name="participants") spectacle = models.ForeignKey(Spectacle, related_name="participants")
@ -184,7 +178,7 @@ class ChoixSpectacle(models.Model):
def __str__(self): def __str__(self):
return "Vœux de %s pour %s" % ( return "Vœux de %s pour %s" % (
self.participant.user.get_full_name, self.participant.user.get_full_name(),
self.spectacle.title) self.spectacle.title)
class Meta: class Meta:
@ -194,7 +188,6 @@ class ChoixSpectacle(models.Model):
verbose_name_plural = "voeux" verbose_name_plural = "voeux"
@python_2_unicode_compatible
class Attribution(models.Model): class Attribution(models.Model):
participant = models.ForeignKey(Participant) participant = models.ForeignKey(Participant)
spectacle = models.ForeignKey(Spectacle, related_name="attribues") spectacle = models.ForeignKey(Spectacle, related_name="attribues")
@ -205,7 +198,6 @@ class Attribution(models.Model):
self.spectacle.date) self.spectacle.date)
@python_2_unicode_compatible
class SpectacleRevente(models.Model): class SpectacleRevente(models.Model):
attribution = models.OneToOneField(Attribution, attribution = models.OneToOneField(Attribution,
related_name="revente") related_name="revente")