project/scipycon/registration/forms.py
author primal primal007@gmail.com
Sun, 11 Sep 2011 16:34:54 +0530
branch2011
changeset 389 fe49720e67bf
parent 318 6963bc54d5c2
child 394 9f2a90e36386
permissions -rw-r--r--
Modified the registration file
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 import forms
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.core.exceptions import ObjectDoesNotExist
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
     3
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
     4
from project.scipycon.registration.models import SIZE_CHOICES
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
     5
from project.scipycon.registration.models import OCCUPATION_CHOICES
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
     6
from project.scipycon.registration.models import Accommodation
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
     7
from project.scipycon.registration.models import Payment
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
     8
from project.scipycon.registration.models import Wifi
96
178b89a3ca4f Removed unwanted files and made more changes to make SciPyCon a clean app.
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
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    11
class RegistrationSubmitForm(forms.Form):
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    12
    """SciPyCon registration form
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    13
    """
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    14
    #tshirt = forms.ChoiceField(choices=SIZE_CHOICES, required=True,
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    15
    #    label=u'T-shirt size', help_text=u'Yes, we all get a t-shirt!')
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    16
    organisation = forms.CharField(required=True, label=u'Organisation',
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    17
        help_text=u'The primary organisation that you are a member of.',
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    18
        max_length=255,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    19
        widget=forms.TextInput(attrs={'size':'50'}))
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    20
    occupation = forms.ChoiceField(choices=OCCUPATION_CHOICES,
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    21
        required=True, label=u'Occupation',
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    22
        help_text=u'Title of your occupation')
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    23
    city = forms.CharField(required=False, label=u'City',
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    24
        help_text=u'Your city of residence',
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    25
        max_length=255,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    26
        widget=forms.TextInput(attrs={'size':'50'}))
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    27
    postcode = forms.CharField(required=False, label=u'Postcode',
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    28
        help_text=u'PIN Code of your area',
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    29
        max_length=10,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    30
        widget=forms.TextInput(attrs={'size':'10'}))
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    31
    phone_num = forms.CharField(required=False, label=u'Phone Number',
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    32
        help_text=u'Phone number. Although optional, please provide it for '
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    33
        'faster correspondence', max_length=14,
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    34
        widget=forms.TextInput(attrs={'size':'20'}))
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    35
    allow_contact = forms.BooleanField(required=False, label=u'Contact',
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    36
        help_text=u'May organizers of SciPy.in contact you after the event?')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    37
    conference = forms.BooleanField(required=False, label=u'Conference',
389
fe49720e67bf Modified the registration file
primal primal007@gmail.com
parents: 318
diff changeset
    38
        help_text=u"""Do you intend to attend SciPy.in 2011 conference?""")
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    39
    tutorial = forms.BooleanField(required=False, label=u'Tutorial',
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    40
        help_text=u'Do you intend to attend the tutorials?')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    41
    sprint = forms.BooleanField(required=False, label=u'Sprint',
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    42
        help_text=u'Do you intend to attend the sprints?')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    43
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    44
    def occupation_fields(self):
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    45
        return (self['organisation'],
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    46
                self['occupation'])
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    47
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    48
    def demographic_fields(self):
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    49
        return (self['city'],
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    50
                self['postcode'],
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    51
                self['phone_num'])
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    52
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    53
    def personal_fields(self):
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    54
        return (#self['tshirt'],
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    55
                self['conference'],
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    56
                self['tutorial'],
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    57
                self['sprint'],
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    58
                self['allow_contact'])
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    59
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    60
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    61
class RegistrationEditForm(RegistrationSubmitForm):
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    62
    id = forms.CharField(widget=forms.HiddenInput)
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    63
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    64
class WifiForm(forms.ModelForm):
246
1bd29275df1f Change docstring for form classes form PyCON to SciPyCON.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 199
diff changeset
    65
    """SciPyCon wifi form
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    66
    """
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    67
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    68
    def save(self, user, scope):
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    69
        try:
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    70
            wifi = Wifi.objects.get(user=user, scope=scope)
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    71
        except ObjectDoesNotExist:
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    72
            wifi = Wifi(user=user, scope=scope)
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    73
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    74
        wifi.wifi = self.cleaned_data['wifi']
272
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 199
diff changeset
    75
        wifi.registration_id = self.cleaned_data['registration_id']
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    76
        wifi.save()
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
    77
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    78
        return wifi
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    79
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    80
    class Meta:
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    81
        model = Wifi
272
4801b7adbbc5 Add registration_id field to Wifi model and make necessary changes in the form.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 199
diff changeset
    82
        fields = ('wifi', 'registration_id')
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
    83
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    84
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    85
class AccommodationForm(forms.ModelForm):
246
1bd29275df1f Change docstring for form classes form PyCON to SciPyCON.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 199
diff changeset
    86
    """SciPyCon Accommodation form
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    87
    """
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    88
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    89
    def save(self, user, scope):
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    90
        try:
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    91
            acco = Accommodation.objects.get(user=user, scope=scope)
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    92
        except ObjectDoesNotExist:
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    93
            acco = Accommodation(user=user, scope=scope)
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    94
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    95
        sex = self.cleaned_data['sex']
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
    96
        accommodation_required = self.cleaned_data['accommodation_required']
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
    97
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
    98
        a1 = self.cleaned_data['accommodation_on_1st']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
    99
        a2 = self.cleaned_data['accommodation_on_2nd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   100
        a3 = self.cleaned_data['accommodation_on_3rd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   101
        a4 = self.cleaned_data['accommodation_on_4th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   102
        a5 = self.cleaned_data['accommodation_on_5th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   103
        a6 = self.cleaned_data['accommodation_on_6th']
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   104
318
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   105
        accommodation_days = [a1, a2, a3, a4, a5, a6].count(True)
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   106
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   107
        acco.sex = sex
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   108
        acco.accommodation_required = accommodation_required
318
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   109
        acco.accommodation_days = accommodation_days
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   110
318
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   111
        acco.accommodation_on_1st = a1
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   112
        acco.accommodation_on_2nd = a2
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   113
        acco.accommodation_on_3rd = a3
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   114
        acco.accommodation_on_4th = a4
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   115
        acco.accommodation_on_5th = a5
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   116
        acco.accommodation_on_6th = a6
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   117
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   118
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   119
        acco.save()
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   120
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   121
        return acco
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   122
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   123
    def clean(self):
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   124
        """Makes sure that accommodation form is correct, i.e. sex
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   125
        and number of days required are filled in when the accommodation
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   126
        is required.
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   127
        """
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   128
        cleaned = self.cleaned_data
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   129
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   130
        sex = self.cleaned_data['sex']
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   131
        accommodation_required = self.cleaned_data['accommodation_required']
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   132
318
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   133
        a1 = self.cleaned_data['accommodation_on_1st']
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   134
        a2 = self.cleaned_data['accommodation_on_2nd']
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   135
        a3 = self.cleaned_data['accommodation_on_3rd']
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   136
        a4 = self.cleaned_data['accommodation_on_4th']
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   137
        a5 = self.cleaned_data['accommodation_on_5th']
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   138
        a6 = self.cleaned_data['accommodation_on_6th']
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   139
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   140
        selected_a_date = any([a1, a2, a3, a4, a5, a6])
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   141
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   142
        if accommodation_required and (not sex or not selected_a_date):
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   143
            #or accommodation_days == 0):
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   144
            raise forms.ValidationError(
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   145
                u"If accommodation is required please specify gender and" 
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   146
                " select the days number for which accommodation is required.")
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   147
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   148
        return super(AccommodationForm, self).clean()
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   149
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   150
    class Meta:
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   151
        model = Accommodation
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   152
        fields = ('accommodation_required',
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   153
                  'sex', 
318
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   154
                  'accommodation_on_1st',
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   155
                  'accommodation_on_2nd',
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   156
                  'accommodation_on_3rd',
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   157
                  'accommodation_on_4th',
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   158
                  'accommodation_on_5th',
6963bc54d5c2 Fix preceding accommodation which were stolen away by magic.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 316
diff changeset
   159
                  'accommodation_on_6th',
315
566e5f783e75 Added six fields corresponding to accomodation in the accomodation model and made corresponding changes to view and form
Nishanth Amuluru <nishanth@fossee.in>
parents: 276
diff changeset
   160
                 )
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   161
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   162
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   163
class PaymentForm(forms.ModelForm):
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   164
    """SciPyCon Payment form
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   165
    """
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   166
262
b7c39720475a Remove the paid field from model form since it is now a dummy form field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 261
diff changeset
   167
    paid = forms.BooleanField(
b7c39720475a Remove the paid field from model form since it is now a dummy form field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 261
diff changeset
   168
        required=False, label="Amount paid",
b7c39720475a Remove the paid field from model form since it is now a dummy form field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 261
diff changeset
   169
        help_text="Check this box if you have already paid the fees.")
b7c39720475a Remove the paid field from model form since it is now a dummy form field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 261
diff changeset
   170
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   171
    def save(self, user, scope):
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   172
        try:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   173
            payment = Payment.objects.get(user=user, scope=scope)
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   174
        except ObjectDoesNotExist:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   175
            payment = Payment(user=user, scope=scope)
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   176
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   177
        paid = self.cleaned_data['paid']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   178
        type = self.cleaned_data['type']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   179
        details = self.cleaned_data['details']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   180
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   181
        payment.type = type
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   182
        payment.details = details
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   183
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   184
        payment.save()
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   185
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   186
        return payment
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   187
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   188
    def clean(self):
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   189
        """Makes sure that payment form is correct, i.e. type and details
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   190
        are filled in when the required fees is paid.
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   191
        """
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   192
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   193
        paid = self.cleaned_data['paid']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   194
        type = self.cleaned_data['type']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   195
        details = self.cleaned_data['details']
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   196
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   197
        if paid and (not type or not details):
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   198
            raise forms.ValidationError(
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   199
                u"If you have already paid the fee it is mandatory to "
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   200
                "fill in the type and mandatory fields.")
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   201
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   202
        return super(PaymentForm, self).clean()
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   203
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   204
    class Meta:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   205
        model = Payment
261
148f277e7db2 Typo of type field twice is fixed to details field in the form of registrantion.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 249
diff changeset
   206
        fields = ('paid', 'type', 'details')
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   207
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   208
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   209
PC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   210
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   211
        ('paid', 'paid'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   212
        ('not paid', 'not paid')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   213
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   214
HC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   215
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   216
        ('party', 'party'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   217
        ('no party', 'no party')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   218
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   219
AC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   220
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   221
        ('0', '0'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   222
        ('10', '10'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   223
        ('20', '20'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   224
        ('40', '40'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   225
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   226
OC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   227
        ('email', 'email'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   228
        ('amount', 'amount'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   229
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   230
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   231
IC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   232
        ('Name', 'name'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   233
        ('Email', 'email'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   234
        ('Amount', 'amount'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   235
        ('Organisation', 'organisation'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   236
        ('Conference', 'conference'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   237
        ('Tutorial', 'tutorial'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   238
        ('Sprint', 'sprint'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   239
        ('T-size', 'tshirt'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   240
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   241
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
   242
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   243
class RegistrationAdminSelectForm(forms.Form):
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   244
    """
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   245
    Used to make selection for csv download
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   246
    """
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   247
    by_payment = forms.ChoiceField(choices=PC, required=False,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   248
        label=u'By payment')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   249
    by_amount = forms.MultipleChoiceField(choices=AC, required=False,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   250
        label=u'By amount')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   251
    by_party = forms.ChoiceField(choices=HC, required=False,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   252
        label=u'by party')
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
   253
    by_tshirt = forms.ChoiceField(choices=SIZE_CHOICES, required=False,
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   254
        label=u'by tshirt size')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   255
    order_by = forms.ChoiceField(choices=OC, required=False,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   256
        label=u'order results')
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   257
    include = forms.MultipleChoiceField(choices=IC, required=False,
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   258
        label=u'Include fields')