reg/models.py
changeset 2 c11afa8623f7
parent 1 18dc0362f550
child 6 057498d12450
equal deleted inserted replaced
1:18dc0362f550 2:c11afa8623f7
    11 
    11 
    12 class Profile(models.Model):
    12 class Profile(models.Model):
    13     """ A model to hold extra information about the user.
    13     """ A model to hold extra information about the user.
    14     """
    14     """
    15 
    15 
       
    16     key = models.CharField(max_length=10, unique=True)
       
    17 
    16     user = models.ForeignKey(User, unique=True)
    18     user = models.ForeignKey(User, unique=True)
    17     gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
    19     gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
    18     profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES)
    20     profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES)
    19     affiliated_to = models.CharField(max_length=100, verbose_name="College/Company")
    21     affiliated_to = models.CharField(max_length=100, verbose_name="College/Company")
    20     interests = models.CharField(max_length=100, verbose_name="Fields of Interest", 
    22     interests = models.CharField(max_length=100, verbose_name="Fields of Interest", 
    21                                  help_text="Ex: Python, Image Processing, Bio Informatics etc.")
    23                                  help_text="Ex: Python, Image Processing, Bio Informatics etc.")
    22 
    24 
       
    25     activation_key = models.CharField(max_length=30, unique=True)
       
    26 
    23 class Event(models.Model):
    27 class Event(models.Model):
    24     """ A model for the workshop information.
    28     """ A model for the workshop information.
    25     """
    29     """
    26 
    30 
       
    31     key = models.CharField(max_length=10, unique=True)
       
    32 
    27     title = models.CharField(max_length=100)
    33     title = models.CharField(max_length=100)
    28     description = models.TextField()
    34     description = models.TextField()
    29     start_date = models.DateField()
    35     start_date = models.DateField()
    30     end_date = models.DateField()
    36     stop_date = models.DateField()
    31     attendees = models.ManyToManyField(User, related_name="%(class)s_attendees")
    37     attendees = models.ManyToManyField(User, related_name="%(class)s_attendees")
    32     organizers = models.ManyToManyField(User, related_name="%(class)s_organizers")
    38     organizers = models.ManyToManyField(User, related_name="%(class)s_organizers")
    33 
    39 
    34     feedback_open = models.BooleanField()
    40     feedback_open = models.BooleanField()
    35     quiz_open = models.BooleanField()
    41     quiz_open = models.BooleanField()