author | nishanth |
Fri, 16 Apr 2010 17:11:47 +0530 | |
changeset 83 | b8f6bc32d8f7 |
parent 56 | 3858a9d0f376 |
child 102 | f9466abf5ca2 |
permissions | -rwxr-xr-x |
0 | 1 |
from django.db import models |
2 |
from django.contrib.auth.models import User |
|
3 |
||
4 |
GENDER_CHOICES = (('M', "Male"), |
|
5 |
('F', 'Female')) |
|
6 |
||
7 |
PROFESSION_CHOICES = (('S', 'Student'), |
|
8 |
('F', 'Faculty'), |
|
9 |
('P', 'Professional')) |
|
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 | 21 |
|
22 |
class Profile(models.Model): |
|
23 |
""" A model to hold extra information about the user. |
|
24 |
""" |
|
25 |
||
26 |
user = models.ForeignKey(User, unique=True) |
|
27 |
gender = models.CharField(max_length=1, choices=GENDER_CHOICES) |
|
28 |
profession = models.CharField(max_length=1, choices=PROFESSION_CHOICES) |
|
29 |
affiliated_to = models.CharField(max_length=100, verbose_name="College/Company") |
|
30 |
interests = models.CharField(max_length=100, verbose_name="Fields of Interest", |
|
31 |
help_text="Ex: Python, Image Processing, Bio Informatics etc.") |
|
32 |
||
2 | 33 |
activation_key = models.CharField(max_length=30, unique=True) |
34 |
||
0 | 35 |
class Event(models.Model): |
36 |
""" A model for the workshop information. |
|
37 |
""" |
|
38 |
||
2 | 39 |
key = models.CharField(max_length=10, unique=True) |
40 |
||
0 | 41 |
title = models.CharField(max_length=100) |
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 | 47 |
attendees = models.ManyToManyField(User, related_name="%(class)s_attendees") |
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 |