Ajout d'un champ 'tirage' aux modèles
This commit is contained in:
parent
9cce1076a9
commit
ac0346d69f
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,7 @@ class Spectacle (models.Model):
|
||||||
price = models.FloatField("Prix d'une place", blank = True)
|
price = models.FloatField("Prix d'une place", blank = True)
|
||||||
slots = models.IntegerField ("Places")
|
slots = models.IntegerField ("Places")
|
||||||
priority = models.IntegerField ("Priorité", default = 1000)
|
priority = models.IntegerField ("Priorité", default = 1000)
|
||||||
|
tirage = models.IntegerField ("Tirage")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Spectacle"
|
verbose_name = "Spectacle"
|
||||||
|
@ -68,6 +69,7 @@ class ChoixSpectacle (models.Model):
|
||||||
spectacle = models.ForeignKey(Spectacle, related_name = "participants")
|
spectacle = models.ForeignKey(Spectacle, related_name = "participants")
|
||||||
priority = models.PositiveIntegerField("Priorité")
|
priority = models.PositiveIntegerField("Priorité")
|
||||||
double_choice = models.CharField("Nombre de places", default = "1", choices = DOUBLE_CHOICES, max_length = 10)
|
double_choice = models.CharField("Nombre de places", default = "1", choices = DOUBLE_CHOICES, max_length = 10)
|
||||||
|
tirage = models.IntegerField("Tirage")
|
||||||
|
|
||||||
def get_double(self):
|
def get_double(self):
|
||||||
return self.double_choice != "1"
|
return self.double_choice != "1"
|
||||||
|
@ -87,6 +89,7 @@ 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")
|
||||||
given = models.BooleanField(u"Donnée", default = False)
|
given = models.BooleanField(u"Donnée", default = False)
|
||||||
|
tirage = models.IntegerField("Tirage")
|
||||||
|
|
||||||
def __unicode__ (self):
|
def __unicode__ (self):
|
||||||
return u"%s -- %s" % (self.participant, self.spectacle)
|
return u"%s -- %s" % (self.participant, self.spectacle)
|
||||||
|
|
Loading…
Reference in a new issue