sdi/models.py
branchanoop
changeset 81 8218d96eb765
parent 78 e84f56d4968e
child 82 408f2bee9abb
equal deleted inserted replaced
80:c200156c80a9 81:8218d96eb765
    40                    ("M","M"),
    40                    ("M","M"),
    41                    ("L","L"),
    41                    ("L","L"),
    42                    ("XL","XL"),                   
    42                    ("XL","XL"),                   
    43                   )
    43                   )
    44 
    44 
       
    45 SPRINT_CHOICES = (("3", "Will sprint for sure"),
       
    46                   ("2", "May sprint"),
       
    47                   ("1", "Not my cup of tea"))
       
    48 
       
    49 EVENT_ATTEND_CHOICES = (("5", "Is attending"),
       
    50                         ("3", "Has been selected but not confirmed participation"),
       
    51                         ("1", "Has registered and is willing to attend"),
       
    52                         ("0", "has registered but might not attend"))
       
    53 
       
    54 WORKSHOP_ATTEND_CHOICES = (("3", "Is attending"),
       
    55                            ("2", "Has been selected but not confirmed participation"),
       
    56                            ("1", "Has requested for a workshop"),
       
    57                            ("0", "Does not need a workshop"))
       
    58 
       
    59 ACCO_CHOICES = (("3", "Has been given accomodation and has confirmed the stay"),
       
    60                 ("2", "Has been given acco but not confirmed yet"),
       
    61                 ("1", "Has requested for accomodation"),
       
    62                 ("0", "Does not need acco"))
       
    63 
    45 class Registrant(models.Model):
    64 class Registrant(models.Model):
    46     """ A model to hold the details of registered users.
    65     """ A model to hold the details of registered users.
    47     """
    66     """
    48 
    67 
    49     first_name = models.CharField(max_length=30)
    68     first_name = models.CharField(max_length=30)
    74     likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES)
    93     likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES)
    75 
    94 
    76     def __unicode__(self):
    95     def __unicode__(self):
    77 
    96 
    78         return self.first_name + " " + self.last_name
    97         return self.first_name + " " + self.last_name
       
    98 
       
    99 class ParticipantInfo(models.Model):
       
   100 
       
   101     participant = models.ForeignKey(Registrant)
       
   102     has_laptop_for_sagedays = models.BooleanField(verbose_name="Will you bring your own laptop for Sage Days 25", default=False)
       
   103 
       
   104     sprinted_already = models.BooleanField(verbose_name="Have you participated in any kind of coding sprints", default=False)
       
   105     will_sprint = models.CharField(max_length=1, verbose_name="Will you sprint", 
       
   106                                    default='1', choices=SPRINT_CHOICES)
       
   107    
       
   108 class RegistrantInfo(models.Model):
       
   109 
       
   110     registrant = models.ForeignKey(Registrant)
       
   111     status_of_attending_sagedays = models.CharField(max_length=1, default="0", choices=EVENT_ATTEND_CHOICES)
       
   112     status_of_attending_python_workshop = models.Charfield(max_length=1, default="0", choices=WORKSHOP_ATTEND_CHOICES)
       
   113     status_of_accomodation = models.CharField(max_length=1, default="0", choices=ACCO_CHOICES)
       
   114     has_laptop_for_python_workshop = models.BooleanField(default=False)
       
   115