forked from DGNum/gestioCOF
Création d'un fichier de requirement
This commit is contained in:
parent
182ba7f614
commit
f704c9f593
10 changed files with 65 additions and 37 deletions
|
@ -57,12 +57,26 @@ class Participant (models.Model):
|
|||
def __unicode__ (self):
|
||||
return u"%s" % (self.user)
|
||||
|
||||
DOUBLE_CHOICES = (
|
||||
("1", "1 place"),
|
||||
("autoquit", "2 places si possible, 1 sinon"),
|
||||
("double", "2 places sinon rien"),
|
||||
)
|
||||
|
||||
class ChoixSpectacle (models.Model):
|
||||
participant = models.ForeignKey(Participant)
|
||||
spectacle = models.ForeignKey(Spectacle, related_name = "participants")
|
||||
priority = models.PositiveIntegerField("Priorité")
|
||||
double = models.BooleanField("Deux places<sup>1</sup>",default=False)
|
||||
autoquit = models.BooleanField("Abandon<sup>2</sup>",default=False)
|
||||
double_choice = models.CharField("Nombre de places", default = "1", choices = DOUBLE_CHOICES, max_length = 10)
|
||||
|
||||
def get_double(self):
|
||||
return self.double_choice != "1"
|
||||
double = property(get_double)
|
||||
|
||||
def get_autoquit(self):
|
||||
return self.double_choice == "autoquit"
|
||||
autoquit = property(get_autoquit)
|
||||
|
||||
class Meta:
|
||||
ordering = ("priority",)
|
||||
unique_together = (("participant", "spectacle",),)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue