sdi/models.py
author nishanth
Sat, 29 May 2010 15:39:55 +0530
changeset 19 3932d9426c44
parent 18 7d587311a4b5
child 28 1c2906cad944
child 29 8bee50ee3504
permissions -rw-r--r--
added the topics field in register form
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     1
from django.db import models
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     2
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     3
GENDER_CHOICES = (('M', "Male"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     4
                  ("F", "Female"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     5
                 )
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
     6
5
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
     7
PYTHON_KNOWLEDGE_CHOICES = (("5", "Written production level code in Python"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
     8
                            ("4", "Been using Python for quite some time"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
     9
                            ("3", "Solved some basic problems using Python"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    10
                            ("2", "I know for sure that Python is a language"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    11
                            ("1", "No clue what Python is"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    12
                           )
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    13
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    14
SAGE_KNOWLEDGE_CHOICES = (("5", "Written production level code in Sage"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    15
                          ("4", "Been using Sage for quite some time"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    16
                          ("3", "Solved some basic problems using Sage"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    17
                          ("2", "I know for sure that Sage is a language"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    18
                          ("1", "No clue what Sage is"),
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    19
                         )
6c4b3796a608 created models in sdi app
nishanth
parents: 4
diff changeset
    20
19
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    21
TOPICS_CHOICES = (("1", "Topic 1"),
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    22
                  ("2", "Topic 2"),
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    23
                  ("3", "Topic 3"),
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    24
                  ("4", "Topic 4"),
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    25
                  ("5", "Topic 5"),
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    26
                 )
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    27
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    28
LIKELINESS_CHOICES = (('5', "Will attend at any cost"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    29
                      ('4', "Will attend most probably"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    30
                      ('3', "Unsure of attending"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    31
                      ('2', "Might not attend"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    32
                      ('1', "Will not attend"),
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    33
                     )
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    34
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    35
class Registrant(models.Model):
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    36
    """ A model to hold the details of registered users.
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    37
    """
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    38
6
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    39
    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
    40
    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
    41
    email = models.EmailField()
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    42
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    43
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    44
    profession = models.CharField(max_length=20)
19
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    45
    affiliated_to = models.CharField(max_length=30, verbose_name="Affiliated Institution/Company")
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    46
18
7d587311a4b5 added blank in topics_interested field in models
nishanth
parents: 15
diff changeset
    47
    topics_interested = models.CharField(max_length=30, blank=True)
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    48
6
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    49
    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
    50
    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
    51
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    52
    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
    53
    tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True)
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    54
19
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    55
    #address = models.TextField(help_text="To send DVD containing tutorials on Python if required.", blank=True)
3932d9426c44 added the topics field in register form
nishanth
parents: 18
diff changeset
    56
    address = models.TextField(blank=True)
15
1c2d2e702aee completed the register view
nishanth
parents: 12
diff changeset
    57
    phone_num = models.CharField(max_length=15, verbose_name="Phone Number", blank=True)
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    58
6
3b3c5f11af8e removed the required=True and added blank=True where it is required in models.py
nishanth
parents: 5
diff changeset
    59
    likeliness_of_attending = models.CharField(max_length=1, choices=LIKELINESS_CHOICES)
4
ac7eaa878437 created app named sdi which means Sage Days India
nishanth
parents:
diff changeset
    60