1 from django.db import models |
1 from django.db import models |
2 |
2 |
3 GENDER_CHOICES = (('M', "Male"), |
3 GENDER_CHOICES = (('M', "Male"), |
4 ("F", "Female"), |
4 ("F", "Female"), |
5 ) |
5 ) |
|
6 |
|
7 PYTHON_KNOWLEDGE_CHOICES = (("5", "Written production level code in Python"), |
|
8 ("4", "Been using Python for quite some time"), |
|
9 ("3", "Solved some basic problems using Python"), |
|
10 ("2", "I know for sure that Python is a language"), |
|
11 ("1", "No clue what Python is"), |
|
12 ) |
|
13 |
|
14 SAGE_KNOWLEDGE_CHOICES = (("5", "Written production level code in Sage"), |
|
15 ("4", "Been using Sage for quite some time"), |
|
16 ("3", "Solved some basic problems using Sage"), |
|
17 ("2", "I know for sure that Sage is a language"), |
|
18 ("1", "No clue what Sage is"), |
|
19 ) |
6 |
20 |
7 LIKELINESS_CHOICES = (('5', "Will attend at any cost"), |
21 LIKELINESS_CHOICES = (('5', "Will attend at any cost"), |
8 ('4', "Will attend most probably"), |
22 ('4', "Will attend most probably"), |
9 ('3', "Unsure of attending"), |
23 ('3', "Unsure of attending"), |
10 ('2', "Might not attend"), |
24 ('2', "Might not attend"), |
11 ('1', "Will not attend"), |
25 ('1', "Will not attend"), |
12 ) |
26 ) |
13 |
|
14 |
27 |
15 class Registrant(models.Model): |
28 class Registrant(models.Model): |
16 """ A model to hold the details of registered users. |
29 """ A model to hold the details of registered users. |
17 """ |
30 """ |
18 |
31 |
23 |
36 |
24 profession = models.CharField(max_length=20, required=True) |
37 profession = models.CharField(max_length=20, required=True) |
25 affiliated_to = models.CharField(max_length=30, required=True) |
38 affiliated_to = models.CharField(max_length=30, required=True) |
26 |
39 |
27 topics_interested = models.TextField() |
40 topics_interested = models.TextField() |
28 knowledge_of_python = models.TextField() |
41 knowledge_of_python = models.CharField(max_length=1, required=True, choices=PYTHON_KNOWLEDGE_CHOICES) |
29 need_for_python_workshop = models.BooleanField() |
42 need_for_python_workshop = models.BooleanField(verbose_name="Do you need a workshop on Python before you attend Sage Days", |
30 knowledge_of_sage = models.TextField() |
43 required=True) |
|
44 knowledge_of_sage = models.CharField(max_length=1, required=True, choices=SAGE_KNOWLEDGE_CHOICES) |
|
45 tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used") |
31 |
46 |
32 tools_used = models.TextField() |
47 address = models.TextField(help_text="To send DVD containing tutorials on Python if required.") |
33 |
|
34 phone_num = models.CharField(max_length=15, required=True) |
48 phone_num = models.CharField(max_length=15, required=True) |
35 address = models.TextField() |
|
36 |
49 |
37 likeliness_of_attending = models.CharField(max_length=1, required=True, choices=LIKELINESS_CHOICES) |
50 likeliness_of_attending = models.CharField(max_length=1, required=True, choices=LIKELINESS_CHOICES) |
38 |
51 |