sdi/models.py
author anoop
Thu, 03 Jun 2010 19:22:41 +0530
changeset 28 1c2906cad944
parent 19 3932d9426c44
permissions -rw-r--r--
changed models.py for new preference order.

from django.db import models

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

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

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

TOPICS_CHOICES = (("1", "Topic 1"),
                  ("2", "Topic 2"),
                  ("3", "Topic 3"),
                  ("4", "Topic 4"),
                  ("5", "Topic 5"),
                 )

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)
    last_name =  models.CharField(max_length=30)
    email = models.EmailField()
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES)

    profession = models.CharField(max_length=20)
    affiliated_to = models.CharField(max_length=30, verbose_name="Affiliated Institution/Company")

    topics_interested = models.CharField(max_length=30, blank=True)

    knowledge_of_python = models.CharField(max_length=1, choices=PYTHON_KNOWLEDGE_CHOICES)
    need_for_python_workshop = models.BooleanField(verbose_name="Do you need a workshop on Python before you attend Sage Days")

    knowledge_of_sage = models.CharField(max_length=1, choices=SAGE_KNOWLEDGE_CHOICES)
    tools_used = models.TextField(help_text="Ex: Scilab, Mathematica, Matlab etc.", verbose_name="Other tools used", blank=True)

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

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