reg/models.py
author nishanth
Thu, 08 Apr 2010 16:35:46 +0530
changeset 1 18dc0362f550
parent 0 30a0f9e20fd4
child 2 c11afa8623f7
permissions -rw-r--r--
app ready on django admin interface. but must take care of anonymous user case .
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     1
from django.db import models
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     2
from django.contrib.auth.models import User
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     3
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     4
GENDER_CHOICES = (('M', "Male"),
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     5
                  ('F', 'Female'))
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     6
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     7
PROFESSION_CHOICES = (('S', 'Student'),
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     8
                      ('F', 'Faculty'),
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
     9
                      ('P', 'Professional'))
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    10
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    11
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    12
class Profile(models.Model):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    13
    """ A model to hold extra information about the user.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    14
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    15
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    16
    user = models.ForeignKey(User, unique=True)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    17
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    18
    profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    19
    affiliated_to = models.CharField(max_length=100, verbose_name="College/Company")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    20
    interests = models.CharField(max_length=100, verbose_name="Fields of Interest", 
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    21
                                 help_text="Ex: Python, Image Processing, Bio Informatics etc.")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    22
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    23
class Event(models.Model):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    24
    """ A model for the workshop information.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    25
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    26
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    27
    title = models.CharField(max_length=100)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    28
    description = models.TextField()
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    29
    start_date = models.DateField()
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    30
    end_date = models.DateField()
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    31
    attendees = models.ManyToManyField(User, related_name="%(class)s_attendees")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    32
    organizers = models.ManyToManyField(User, related_name="%(class)s_organizers")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    33
1
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    34
    feedback_open = models.BooleanField()
18dc0362f550 app ready on django admin interface. but must take care of anonymous user case .
nishanth
parents: 0
diff changeset
    35
    quiz_open = models.BooleanField()