project/scipycon/registration/models.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Thu, 18 Nov 2010 16:10:38 +0530
branchsouth-migration
changeset 275 679a9cab4bf1
parent 272 4801b7adbbc5
parent 238 0149f28a4f74
child 276 325ec5a41269
permissions -rw-r--r--
Merge the south migration branch with an additional field for Laptop registration number with default branch.
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
117
1b68c8aa6091 Renamed and reordered the imports.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     6
from project.scipycon.registration.labels import WIFI_CHOICES
1b68c8aa6091 Renamed and reordered the imports.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 104
diff changeset
     7
from project.scipycon.registration.labels import WIFI_HELP
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     8
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
     9
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    10
SIZE_CHOICES = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
    ('S', 'S'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    12
    ('M', 'M'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
    ('L', 'L'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    14
    ('XL', 'XL'),
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    15
    ('XXL', 'XXL'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    16
    )
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    17
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    18
OCCUPATION_CHOICES = (
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    19
    ('Education: Student', 'Education: Student'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    20
    ('Education: Faculty', 'Education: Faculty'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    21
    ('Education: Research', 'Education: Research'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    22
    ('Education: Other', 'Education: Other'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    23
    ('Corporate: Research', 'Corporate: Research'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    24
    ('Corporate: Other', 'Corporate: Other'),
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    25
    ('Other', 'Other')
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    26
    )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    27
198
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    28
SEX_CHOICES = (
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    29
    ('Male', 'Male'),
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    30
    ('Female', 'Female'),
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    31
    )
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
272
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    33
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    34
class Wifi(base_models.ScopedBase):
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    35
    """Defines wifi options at SciPy.in
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    36
    """
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    37
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    38
    user = models.ForeignKey(User)
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    39
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    40
    wifi = models.CharField(max_length=50, choices=WIFI_CHOICES,
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    41
                            help_text=WIFI_HELP, verbose_name="Laptop")
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    42
272
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    43
    registration_id = models.CharField(
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    44
        max_length=255, verbose_name="Identification Number",
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    45
        help_text="- Provide the serial or identification number at the "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    46
        "back of your laptop using which your laptop can be uniquely "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    47
        "identified. Ex: 8BDB8FB (Service Tag on Dell Laptops).<br /> - "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    48
        "This is for security reasons and will be used while you enter and "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    49
        "leave the venue.<br /> - Please don't provide the model number "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    50
        "like Dell Inspiron 1545. There may be many laptops of that model "
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    51
        "and hence your laptop cannot be uniquely identified.",
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    52
        blank=True, null=True)
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 226
diff changeset
    53
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
    54
198
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    55
class Accommodation(base_models.ScopedBase):
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    56
    """Defines accommodation information for SciPy.in
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    57
    """
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    58
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    59
    user = models.ForeignKey(User)
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    60
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    61
    sex = models.CharField(max_length=50, choices=SEX_CHOICES,
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    62
                           verbose_name="Gender",
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    63
                           blank=True, null=True)
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    64
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    65
    accommodation_required = models.BooleanField(
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    66
        default=False, blank=True,
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    67
        verbose_name="Accommodation required",
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    68
        help_text="Check if you need accommodation.")
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    69
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    70
    accommodation_days = models.IntegerField(
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    71
        default=0, blank=True,
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    72
        verbose_name="Number of days",
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    73
        help_text="Number of days the accommodation is required for?")
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    74
92fbbbc4c97a Added Django model for accommodation forms.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    75
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    76
class Registration(base_models.ScopedBase):
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
    77
    """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
    78
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    79
    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
    80
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    81
    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
    82
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    83
    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
    84
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    85
    occupation = models.CharField(max_length=255,
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    86
                                  choices=OCCUPATION_CHOICES, 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
    87
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    88
    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
    89
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    90
    postcode = models.CharField(max_length=255, blank=True)
104
1a83a26756c3 Renamed Base Model with scope and propogated it to other models.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 101
diff changeset
    91
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
    92
    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
    93
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 117
diff changeset
    94
    tshirt = models.CharField(max_length=3, 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
    95
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
    96
    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
    97
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    98
    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
    99
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   100
    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
   101
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
   102
    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
   103
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
   104
    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
   105
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
   106
    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
   107
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   108
    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
   109
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   110
    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
   111
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   112
    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
   113
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   114
    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
   115
        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
   116
            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
   117
            self.registrant.last_name, self.registrant.email)
236
29ecd3dd6565 Merging heads
Amit Sethi
parents: 137
diff changeset
   118
29ecd3dd6565 Merging heads
Amit Sethi
parents: 137
diff changeset
   119
238
0149f28a4f74 Merging heads
Amit Sethi
parents: 236 226
diff changeset
   120