sdi/models.py
author nishanth
Sat, 29 May 2010 09:36:16 +0530
changeset 5 6c4b3796a608
parent 4 ac7eaa878437
child 6 3b3c5f11af8e
permissions -rw-r--r--
created models in sdi app

from django.db import models

GENDER_CHOICES = (('M', "Male"),
                  ("F", "Female"),
                 )

PYTHON_KNOWLEDGE_CHOICES = (("5", "Written production level code in Python"),
                            ("4", "Been using Python for quite some time"),
                            ("3", "Solved some basic problems using Python"),
                            ("2", "I know for sure that Python is a language"),
                            ("1", "No clue what Python is"),
                           )

SAGE_KNOWLEDGE_CHOICES = (("5", "Written production level code in Sage"),
                          ("4", "Been using Sage for quite some time"),
                          ("3", "Solved some basic problems using Sage"),
                          ("2", "I know for sure that Sage is a language"),
                          ("1", "No clue what Sage is"),
                         )

LIKELINESS_CHOICES = (('5', "Will attend at any cost"),
                      ('4', "Will attend most probably"),
                      ('3', "Unsure of attending"),
                      ('2', "Might not attend"),
                      ('1', "Will not attend"),
                     )

class Registrant(models.Model):
    """ A model to hold the details of registered users.
    """

    first_name = models.CharField(max_length=30, required=True)
    last_name =  models.CharField(max_length=30, required=True)
    email = models.EmailField(required=True)
    gender = models.CharField(max_length=1, required=True, choices=GENDER_CHOICES)

    profession = models.CharField(max_length=20, required=True)
    affiliated_to = models.CharField(max_length=30, required=True)

    topics_interested = models.TextField()
    knowledge_of_python = models.CharField(max_length=1, required=True, choices=PYTHON_KNOWLEDGE_CHOICES)
    need_for_python_workshop = models.BooleanField(verbose_name="Do you need a workshop on Python before you attend Sage Days", 
                                                   required=True)
    knowledge_of_sage = models.CharField(max_length=1, required=True, choices=SAGE_KNOWLEDGE_CHOICES)
    tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used")

    address = models.TextField(help_text="To send DVD containing tutorials on Python if required.")
    phone_num = models.CharField(max_length=15, required=True)

    likeliness_of_attending = models.CharField(max_length=1, required=True, choices=LIKELINESS_CHOICES)