author | nishanth |
Tue, 29 Jun 2010 16:12:29 +0530 | |
changeset 103 | ee9261c5ba18 |
parent 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") |
|
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 | 31 |
|
2 | 32 |
activation_key = models.CharField(max_length=30, unique=True) |
33 |
||
0 | 34 |
class Event(models.Model): |
35 |
""" A model for the workshop information. |
|
36 |
""" |
|
37 |
||
2 | 38 |
key = models.CharField(max_length=10, unique=True) |
39 |
||
0 | 40 |
title = models.CharField(max_length=100) |
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 | 46 |
attendees = models.ManyToManyField(User, related_name="%(class)s_attendees") |
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 |