author | nishanth |
Fri, 16 Jul 2010 10:07:13 +0530 | |
branch | anoop |
changeset 101 | 9def10724853 |
parent 83 | 736b2945037f |
child 152 | 86bfdb64edb5 |
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 |
||
34 | 31 |
|
4 | 32 |
LIKELINESS_CHOICES = (('5', "Will attend at any cost"), |
33 |
('4', "Will attend most probably"), |
|
34 |
('3', "Unsure of attending"), |
|
35 |
('2', "Might not attend"), |
|
36 |
('1', "Will not attend"), |
|
37 |
) |
|
38 |
||
49 | 39 |
T_SHIRT_CHOICES = (("S","S"), |
40 |
("M","M"), |
|
41 |
("L","L"), |
|
42 |
("XL","XL"), |
|
43 |
) |
|
44 |
||
81 | 45 |
SPRINT_CHOICES = (("3", "Will sprint for sure"), |
46 |
("2", "May sprint"), |
|
47 |
("1", "Not my cup of tea")) |
|
48 |
||
49 |
EVENT_ATTEND_CHOICES = (("5", "Is attending"), |
|
50 |
("3", "Has been selected but not confirmed participation"), |
|
51 |
("1", "Has registered and is willing to attend"), |
|
52 |
("0", "has registered but might not attend")) |
|
53 |
||
54 |
WORKSHOP_ATTEND_CHOICES = (("3", "Is attending"), |
|
55 |
("2", "Has been selected but not confirmed participation"), |
|
56 |
("1", "Has requested for a workshop"), |
|
57 |
("0", "Does not need a workshop")) |
|
58 |
||
59 |
ACCO_CHOICES = (("3", "Has been given accomodation and has confirmed the stay"), |
|
60 |
("2", "Has been given acco but not confirmed yet"), |
|
61 |
("1", "Has requested for accomodation"), |
|
62 |
("0", "Does not need acco")) |
|
63 |
||
4 | 64 |
class Registrant(models.Model): |
65 |
""" A model to hold the details of registered users. |
|
66 |
""" |
|
67 |
||
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
68 |
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
|
69 |
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
|
70 |
email = models.EmailField() |
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
71 |
gender = models.CharField(max_length=1, choices=GENDER_CHOICES) |
49 | 72 |
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
|
73 |
|
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
74 |
profession = models.CharField(max_length=20) |
19 | 75 |
affiliated_to = models.CharField(max_length=30, verbose_name="Affiliated Institution/Company") |
4 | 76 |
|
18 | 77 |
topics_interested = models.CharField(max_length=30, blank=True) |
4 | 78 |
|
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
79 |
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
|
80 |
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
|
81 |
|
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
82 |
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
|
83 |
tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True) |
4 | 84 |
|
19 | 85 |
#address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True) |
86 |
address = models.TextField(blank=True) |
|
15 | 87 |
phone_num = models.CharField(max_length=15, verbose_name="Phone Number", blank=True) |
45 | 88 |
acco_required = models.BooleanField(verbose_name="Need accomodation", default=False) |
4 | 89 |
|
45 | 90 |
priority_for_attending = models.CharField(max_length=1, default="3") |
91 |
selected_for_attending = models.BooleanField(default=False) |
|
92 |
||
6
3b3c5f11af8e
removed the required=True and added blank=True where it is required in models.py
nishanth
parents:
5
diff
changeset
|
93 |
likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES) |
4 | 94 |
|
78 | 95 |
def __unicode__(self): |
96 |
||
97 |
return self.first_name + " " + self.last_name |
|
81 | 98 |
|
99 |
class ParticipantInfo(models.Model): |
|
100 |
||
101 |
participant = models.ForeignKey(Registrant) |
|
102 |
has_laptop_for_sagedays = models.BooleanField(verbose_name="Will you bring your own laptop for Sage Days 25", default=False) |
|
103 |
||
104 |
sprinted_already = models.BooleanField(verbose_name="Have you participated in any kind of coding sprints", default=False) |
|
105 |
will_sprint = models.CharField(max_length=1, verbose_name="Will you sprint", |
|
106 |
default='1', choices=SPRINT_CHOICES) |
|
107 |
||
108 |
class RegistrantInfo(models.Model): |
|
109 |
||
110 |
registrant = models.ForeignKey(Registrant) |
|
111 |
status_of_attending_sagedays = models.CharField(max_length=1, default="0", choices=EVENT_ATTEND_CHOICES) |
|
83 | 112 |
status_of_attending_workshop = models.CharField(max_length=1, default="0", choices=WORKSHOP_ATTEND_CHOICES) |
81 | 113 |
status_of_accomodation = models.CharField(max_length=1, default="0", choices=ACCO_CHOICES) |
82 | 114 |
has_laptop_for_workshop = models.BooleanField(default=False) |
81 | 115 |