reg/models.py
author nishanth
Mon, 26 Apr 2010 17:57:44 +0530
changeset 102 f9466abf5ca2
parent 56 3858a9d0f376
permissions -rwxr-xr-x
removed the help text for interests. ppl are simply copying
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
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    11
FEEDBACK_CHOICES = (('0', 'Closed'),
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    12
                    ('1', 'Day 1 Open'),
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    13
                    ('2', 'Day 2 Open'),
10
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    14
                   )
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    15
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    16
QUIZ_CHOICES = (('00', 'Closed'),
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    17
                ('11', 'Day1 Quiz1 Open'),
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    18
                ('12', 'Day1 Quiz2 Open'),
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    19
                ('21', 'Day2 Quiz1 Open'),
10
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    20
               )
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    21
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    22
class Profile(models.Model):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    23
    """ A model to hold extra information about the user.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    24
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    25
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    26
    user = models.ForeignKey(User, unique=True)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    27
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    28
    profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    29
    affiliated_to = models.CharField(max_length=100, verbose_name="College/Company")
102
f9466abf5ca2 removed the help text for interests. ppl are simply copying
nishanth
parents: 56
diff changeset
    30
    interests = models.CharField(max_length=100, verbose_name="Fields of Interest")
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    31
2
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    32
    activation_key = models.CharField(max_length=30, unique=True)
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    33
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    34
class Event(models.Model):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    35
    """ A model for the workshop information.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    36
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    37
2
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    38
    key = models.CharField(max_length=10, unique=True)
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    39
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    40
    title = models.CharField(max_length=100)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    41
    description = models.TextField()
18
7dae32a2439b prettified the home page and moved workshops to another page called workshops.
nishanth
parents: 11
diff changeset
    42
    start_date = models.DateField(verbose_name="Start Date")
7dae32a2439b prettified the home page and moved workshops to another page called workshops.
nishanth
parents: 11
diff changeset
    43
    stop_date = models.DateField(verbose_name="End Date")
43
757d1da69255 added venue field in event model and corresponding forms and views.
nishanth
parents: 18
diff changeset
    44
    venue = models.CharField(max_length=100, help_text="College name and city")
757d1da69255 added venue field in event model and corresponding forms and views.
nishanth
parents: 18
diff changeset
    45
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    46
    attendees = models.ManyToManyField(User, related_name="%(class)s_attendees")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    47
    organizers = models.ManyToManyField(User, related_name="%(class)s_organizers")
10
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    48
    
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    49
    registration_is_open = models.BooleanField(default=False)
10
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    50
    feedback_status = models.CharField(max_length=1, choices=FEEDBACK_CHOICES, default='0')
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    51
    quiz_status = models.CharField(max_length=2, choices=QUIZ_CHOICES, default='00')
6
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    52
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    53
    def __unicode__(self):
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    54
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    55
        return self.title