forked from DGNum/gestioCOF
Grod commit dégueux avec une tonne de trucs. Berk.
This commit is contained in:
parent
d5b3d3f958
commit
64b8ee4133
17 changed files with 536 additions and 209 deletions
|
@ -24,6 +24,11 @@ TYPE_COTIZ_CHOICES = (
|
|||
('exterieur', _(u"Extérieur")),
|
||||
)
|
||||
|
||||
TYPE_COMMENT_FIELD = (
|
||||
('text', _(u"Texte long")),
|
||||
('char', _(u"Texte court")),
|
||||
)
|
||||
|
||||
def choices_length (choices):
|
||||
return reduce (lambda m, choice: max (m, len (choice[0])), choices, 0)
|
||||
|
||||
|
@ -45,6 +50,7 @@ class CofProfile(models.Model):
|
|||
mailing_cof = models.BooleanField("Recevoir les mails COF", default = False)
|
||||
mailing_bda = models.BooleanField("Recevoir les mails BdA", default = False)
|
||||
mailing_bda_revente = models.BooleanField("Recevoir les mails de revente de places BdA", default = False)
|
||||
comments = models.TextField("Commentaires visibles uniquement par le Buro", blank = True)
|
||||
is_buro = models.BooleanField("Membre du Burô", default = False)
|
||||
petits_cours_accept = models.BooleanField("Recevoir des petits cours", default = False)
|
||||
petits_cours_remarques = models.TextField(_(u"Remarques et précisions pour les petits cours"),
|
||||
|
@ -62,6 +68,24 @@ def create_user_profile(sender, instance, created, **kwargs):
|
|||
CofProfile.objects.get_or_create(user = instance)
|
||||
post_save.connect(create_user_profile, sender = User)
|
||||
|
||||
class Club(models.Model):
|
||||
name = models.CharField("Nom", max_length = 200)
|
||||
description = models.TextField("Description")
|
||||
respos = models.ManyToManyField(User, related_name = "clubs_geres")
|
||||
membres = models.ManyToManyField(User, related_name = "clubs")
|
||||
|
||||
class CustomMail(models.Model):
|
||||
shortname = models.SlugField(max_length = 50, blank = False)
|
||||
title = models.CharField("Titre", max_length = 200, blank = False)
|
||||
content = models.TextField("Contenu", blank = False)
|
||||
comments = models.TextField("Informations contextuelles sur le mail", blank = True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Mails personnalisables"
|
||||
|
||||
def __unicode__(self):
|
||||
return u"%s: %s" % (self.shortname, self.title)
|
||||
|
||||
class Event(models.Model):
|
||||
title = models.CharField("Titre", max_length = 200)
|
||||
location = models.CharField("Lieu", max_length = 200)
|
||||
|
@ -77,6 +101,23 @@ class Event(models.Model):
|
|||
def __unicode__(self):
|
||||
return unicode(self.title)
|
||||
|
||||
class EventCommentField(models.Model):
|
||||
event = models.ForeignKey(Event, related_name = "commentfields")
|
||||
name = models.CharField("Champ", max_length = 200)
|
||||
fieldtype = models.CharField("Type", max_length = 10, choices = TYPE_COMMENT_FIELD, default = "text")
|
||||
default = models.TextField("Valeur par défaut", blank = True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Champ"
|
||||
|
||||
def __unicode__(self):
|
||||
return unicode(self.name)
|
||||
|
||||
class EventCommentValue(models.Model):
|
||||
commentfield = models.ForeignKey(EventCommentField, related_name = "values")
|
||||
registration = models.ForeignKey("EventRegistration", related_name = "comments")
|
||||
content = models.TextField("Contenu", blank = True, null = True)
|
||||
|
||||
class EventOption(models.Model):
|
||||
event = models.ForeignKey(Event, related_name = "options")
|
||||
name = models.CharField("Option", max_length = 200)
|
||||
|
@ -102,6 +143,7 @@ class EventRegistration(models.Model):
|
|||
user = models.ForeignKey(User)
|
||||
event = models.ForeignKey(Event)
|
||||
options = models.ManyToManyField(EventOptionChoice)
|
||||
filledcomments = models.ManyToManyField(EventCommentField, through = EventCommentValue)
|
||||
paid = models.BooleanField("A payé", default = False)
|
||||
|
||||
class Meta:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue