author | anoop |
Thu, 19 Aug 2010 18:20:27 +0530 | |
branch | anoop |
changeset 231 | 97290cc22eb5 |
parent 213 | ffe5ef840fde |
child 233 | c5df028e4438 |
permissions | -rw-r--r-- |
4 | 1 |
from django.db import models |
2 |
||
3 |
GENDER_CHOICES = (('M', "Male"), |
|
4 |
("F", "Female"), |
|
5 |
) |
|
6 |
||
29 | 7 |
PYTHON_KNOWLEDGE_CHOICES = (("1", "No clue what Python is"), |
8 |
("2", "I know for sure that Python is a language"), |
|
5 | 9 |
("3", "Solved some basic problems using Python"), |
29 | 10 |
("4", "Been using Python for quite some time"), |
11 |
("5", "Written production level code in Python"), |
|
5 | 12 |
) |
13 |
||
29 | 14 |
SAGE_KNOWLEDGE_CHOICES = (("1", "No clue what Sage is"), |
74 | 15 |
("2", "I know for sure that Sage is a mathematical software"), |
5 | 16 |
("3", "Solved some basic problems using Sage"), |
29 | 17 |
("4", "Been using Sage for quite some time"), |
74 | 18 |
#("5", "Written production level code in Sage"), |
5 | 19 |
) |
20 |
||
34 | 21 |
TOPICS_CHOICES = (("1", "Cryptography"), |
22 |
("2", "Basic Algebra"), |
|
23 |
("3", "Calculus"), |
|
24 |
("4", "Arbitrary Precision Numerics"), |
|
25 |
("5", "Basic Plotting"), |
|
26 |
("6", "Number Theory"), |
|
27 |
("7", "Polynomials"), |
|
28 |
("8", "Combinatorics and Graph Theory"), |
|
19 | 29 |
) |
30 |
||
4 | 31 |
LIKELINESS_CHOICES = (('5', "Will attend at any cost"), |
32 |
('4', "Will attend most probably"), |
|
33 |
('3', "Unsure of attending"), |
|
34 |
('2', "Might not attend"), |
|
35 |
('1', "Will not attend"), |
|
36 |
) |
|
37 |
||
49 | 38 |
T_SHIRT_CHOICES = (("S","S"), |
39 |
("M","M"), |
|
40 |
("L","L"), |
|
41 |
("XL","XL"), |
|
42 |
) |
|
43 |
||
81 | 44 |
SPRINT_CHOICES = (("3", "Will sprint for sure"), |
45 |
("2", "May sprint"), |
|
46 |
("1", "Not my cup of tea")) |
|
47 |
||
48 |
EVENT_ATTEND_CHOICES = (("5", "Is attending"), |
|
49 |
("3", "Has been selected but not confirmed participation"), |
|
50 |
("1", "Has registered and is willing to attend"), |
|
51 |
("0", "has registered but might not attend")) |
|
52 |
||
53 |
WORKSHOP_ATTEND_CHOICES = (("3", "Is attending"), |
|
54 |
("2", "Has been selected but not confirmed participation"), |
|
55 |
("1", "Has requested for a workshop"), |
|
56 |
("0", "Does not need a workshop")) |
|
57 |
||
213
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
58 |
ACCO_CHOICES = (("3", "Has requested but request has been rejected"), |
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
59 |
("2", "Has been given accomodation"), |
81 | 60 |
("1", "Has requested for accomodation"), |
61 |
("0", "Does not need acco")) |
|
62 |
||
213
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
63 |
ACCO_LOCATION_CHOICES = (("2", "NITIE"), |
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
64 |
("1", "IITB Guest house"), |
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
65 |
("0", "IITB Hostel")) |
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
66 |
|
4 | 67 |
class Registrant(models.Model): |
68 |
""" A model to hold the details of registered users. |
|
69 |
""" |
|
70 |
||
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
71 |
first_name = models.CharField(max_length=30) |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
72 |
last_name = models.CharField(max_length=30) |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
73 |
email = models.EmailField() |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
74 |
gender = models.CharField(max_length=1, choices=GENDER_CHOICES) |
49 | 75 |
t_shirt_size = models.CharField(max_length=2, choices=T_SHIRT_CHOICES, verbose_name="T-Shirt size") |
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
76 |
|
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
77 |
profession = models.CharField(max_length=20) |
19 | 78 |
affiliated_to = models.CharField(max_length=30, verbose_name="Affiliated Institution/Company") |
4 | 79 |
|
18 | 80 |
topics_interested = models.CharField(max_length=30, blank=True) |
4 | 81 |
|
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
82 |
knowledge_of_python = models.CharField(max_length=1, choices=PYTHON_KNOWLEDGE_CHOICES) |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
83 |
need_for_python_workshop = models.BooleanField(verbose_name="Do you need a workshop on Python before you attend Sage Days") |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
84 |
|
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
85 |
knowledge_of_sage = models.CharField(max_length=1, choices=SAGE_KNOWLEDGE_CHOICES) |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
86 |
tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True) |
4 | 87 |
|
19 | 88 |
#address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True) |
89 |
address = models.TextField(blank=True) |
|
15 | 90 |
phone_num = models.CharField(max_length=15, verbose_name="Phone Number", blank=True) |
45 | 91 |
acco_required = models.BooleanField(verbose_name="Need accomodation", default=False) |
4 | 92 |
|
45 | 93 |
priority_for_attending = models.CharField(max_length=1, default="3") |
94 |
selected_for_attending = models.BooleanField(default=False) |
|
95 |
||
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
96 |
likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES) |
4 | 97 |
|
78 | 98 |
def __unicode__(self): |
99 |
||
100 |
return self.first_name + " " + self.last_name |
|
81 | 101 |
|
102 |
class ParticipantInfo(models.Model): |
|
103 |
||
104 |
participant = models.ForeignKey(Registrant) |
|
105 |
has_laptop_for_sagedays = models.BooleanField(verbose_name="Will you bring your own laptop for Sage Days 25", default=False) |
|
106 |
||
107 |
sprinted_already = models.BooleanField(verbose_name="Have you participated in any kind of coding sprints", default=False) |
|
108 |
will_sprint = models.CharField(max_length=1, verbose_name="Will you sprint", |
|
109 |
default='1', choices=SPRINT_CHOICES) |
|
110 |
||
111 |
class RegistrantInfo(models.Model): |
|
112 |
||
113 |
registrant = models.ForeignKey(Registrant) |
|
114 |
status_of_attending_sagedays = models.CharField(max_length=1, default="0", choices=EVENT_ATTEND_CHOICES) |
|
83 | 115 |
status_of_attending_workshop = models.CharField(max_length=1, default="0", choices=WORKSHOP_ATTEND_CHOICES) |
81 | 116 |
status_of_accomodation = models.CharField(max_length=1, default="0", choices=ACCO_CHOICES) |
82 | 117 |
has_laptop_for_workshop = models.BooleanField(default=False) |
213
ffe5ef840fde
Added an extra field to RegistrantInfo Model to hold accommodation location of participants.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
174
diff
changeset
|
118 |
acco_location = models.CharField(max_length=1, choices=ACCO_LOCATION_CHOICES, null=True) |