reg/models.py
author nishanth
Fri, 16 Apr 2010 17:11:47 +0530
changeset 83 b8f6bc32d8f7
parent 56 3858a9d0f376
child 102 f9466abf5ca2
permissions -rwxr-xr-x
added line break in view event
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")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    30
    interests = models.CharField(max_length=100, verbose_name="Fields of Interest", 
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    31
                                 help_text="Ex: Python, Image Processing, Bio Informatics etc.")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    32
2
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    33
    activation_key = models.CharField(max_length=30, unique=True)
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    34
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    35
class Event(models.Model):
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    36
    """ A model for the workshop information.
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    37
    """
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    38
2
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    39
    key = models.CharField(max_length=10, unique=True)
c11afa8623f7 incorporated gen_key .
nishanth
parents: 1
diff changeset
    40
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    41
    title = models.CharField(max_length=100)
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    42
    description = models.TextField()
18
7dae32a2439b prettified the home page and moved workshops to another page called workshops.
nishanth
parents: 11
diff changeset
    43
    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
    44
    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
    45
    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
    46
0
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    47
    attendees = models.ManyToManyField(User, related_name="%(class)s_attendees")
30a0f9e20fd4 initial commit
nishanth
parents:
diff changeset
    48
    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
    49
    
11
334550460bd7 added the view event functionality and submitting feedback according to the status .
nishanth
parents: 10
diff changeset
    50
    registration_is_open = models.BooleanField(default=False)
10
c52d170969f0 quite a few changes. modified models and feedback views .
nishanth
parents: 8
diff changeset
    51
    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
    52
    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
    53
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    54
    def __unicode__(self):
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    55
057498d12450 users can now register but still there is no concept of activation e-mail .
nishanth
parents: 2
diff changeset
    56
        return self.title