project/scipycon/registration/models.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Wed, 14 Jul 2010 19:34:12 +0530
changeset 101 61fc4aa7a09a
parent 94 87e77aa18610
child 104 1a83a26756c3
permissions -rw-r--r--
Added base app from which all other apps inherit and made corresponding changes in other apps.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     1
from django.db import models
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     2
from django.contrib.auth.models import User
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
     4
from project.scipycon.base import models as base_models
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
     5
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     6
from .utils import send_confirmation_payment_email
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     7
from .utils import send_banking_fix_email
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     9
from .labels import WIFI_CHOICES
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
from .labels import WIFI_HELP
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    12
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
SIZE_CHOICES = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    14
    ('S', 'S'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    15
    ('M', 'M'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    16
    ('L', 'L'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    17
    ('XL', 'XL'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    18
    )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    19
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    20
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    21
class Wifi(base_models.Base):
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    22
    """Defines wifi options at *PyCon"""
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    23
    user = models.ForeignKey(User)
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    24
    wifi = models.CharField(max_length=50, choices=WIFI_CHOICES,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    25
            help_text=WIFI_HELP, verbose_name="Laptop")
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    26
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    27
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    28
class Registration(base_models.Model):
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    29
    """Defines registration at SciPy.in"""
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    30
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    31
    slug = models.SlugField()
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    32
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    33
    registrant = models.ForeignKey(User)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    34
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    35
    organisation = models.CharField(max_length=255, blank=True)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    36
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    37
    occupation = models.CharField(max_length=255, blank=True)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    38
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    39
    city = models.CharField(max_length=255, blank=True)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    40
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    41
    postcode = models.CharField(max_length=255, blank=True)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    42
    
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    43
    phone_num = models.CharField(max_length=14, blank=True)
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    44
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    45
    tshirt = models.CharField(max_length=2, choices=SIZE_CHOICES)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    46
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    47
    conference = models.BooleanField(default=False)
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    48
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    49
    tutorial = models.BooleanField(default=False)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    50
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    51
    sprint = models.BooleanField(default=False)
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    52
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    53
    final_conference = models.BooleanField(default=False)
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    54
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    55
    final_tutorial = models.BooleanField(default=False)
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    56
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    57
    final_sprint = models.BooleanField(default=False)
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    58
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    59
    allow_contact = models.BooleanField(default=False)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    60
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    61
    submitted = models.DateTimeField(auto_now_add=True)
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    62
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    63
    last_mod = models.DateTimeField(auto_now=True)
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    64
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    65
    def __unicode__(self):
101
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    66
        return 'Registration for user: <%s %s> %s' % (
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    67
            self.registrant.first_name,
61fc4aa7a09a Added base app from which all other apps inherit and made corresponding changes in other apps.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 94
diff changeset
    68
            self.registrant.last_name, self.registrant.email)