project/scipycon/registration/forms.py
author Madhusudan.C.S <madhusudancs@gmail.com>
Tue, 30 Nov 2010 15:58:17 +0530
changeset 316 88ff5f6b43f4
parent 315 566e5f783e75
child 318 6963bc54d5c2
permissions -rw-r--r--
Fixing accommodation typo.
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',
191
0eb941d14ec3 Changing the fee details in the registration form to the link.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 137
diff changeset
    38
        help_text=u"""Do you intend to attend SciPy.in 2010 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
        accommodation_days = sum(filter([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
    98
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
    99
        a1 = self.cleaned_data['accommodation_on_1st']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   100
        a2 = self.cleaned_data['accommodation_on_2nd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   101
        a3 = self.cleaned_data['accommodation_on_3rd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   102
        a4 = self.cleaned_data['accommodation_on_4th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   103
        a5 = self.cleaned_data['accommodation_on_5th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   104
        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
   105
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   106
        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
   107
        acco.accommodation_required = accommodation_required
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   108
        acco.accommodation_days = _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
   109
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   110
        acco._on_1st = a1
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   111
        acco._on_2nd = a2
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   112
        acco._on_3rd = a3
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   113
        acco._on_4th = a4
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   114
        acco._on_5th = a5
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   115
        acco._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
   116
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   117
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   118
        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
   119
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   120
        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
   121
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   122
    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
   123
        """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
   124
        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
   125
        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
   126
        """
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   127
        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
   128
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   129
        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
   130
        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
   131
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   132
        a1 = self.cleaned_data['_on_1st']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   133
        a2 = self.cleaned_data['_on_2nd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   134
        a3 = self.cleaned_data['_on_3rd']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   135
        a4 = self.cleaned_data['_on_4th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   136
        a5 = self.cleaned_data['_on_5th']
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   137
        a6 = self.cleaned_data['_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
   138
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
   139
        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
   140
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
        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
   142
            #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
   143
            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
   144
                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
   145
                " 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
   146
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   147
        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
   148
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   149
    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
   150
        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
   151
        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
   152
                  'sex', 
316
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   153
                  '_on_1st',
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   154
                  '_on_2nd',
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   155
                  '_on_3rd',
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   156
                  '_on_4th',
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   157
                  '_on_5th',
88ff5f6b43f4 Fixing accommodation typo.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 315
diff changeset
   158
                  '_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
   159
                 )
199
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   160
97cbeda302a9 Added accommodation Django form, wrote the save method and overwrote the cleaner.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 191
diff changeset
   161
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   162
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
   163
    """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
   164
    """
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   165
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
   166
    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
   167
        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
   168
        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
   169
249
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   170
    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
   171
        try:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   172
            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
   173
        except ObjectDoesNotExist:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   174
            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
   175
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   176
        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
   177
        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
   178
        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
   179
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   180
        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
   181
        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
   182
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   183
        payment.save()
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   184
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   185
        return payment
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   186
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   187
    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
   188
        """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
   189
        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
   190
        """
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
        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
   193
        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
   194
        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
   195
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   196
        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
   197
            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
   198
                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
   199
                "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
   200
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   201
        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
   202
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   203
    class Meta:
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   204
        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
   205
        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
   206
9d90fbae1216 Add a form for Payment and respective save and clean methods.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 246
diff changeset
   207
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   208
PC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   209
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   210
        ('paid', 'paid'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   211
        ('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
   212
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   213
HC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   214
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   215
        ('party', 'party'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   216
        ('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
   217
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   218
AC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   219
        ('all', 'all'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   220
        ('0', '0'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   221
        ('10', '10'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   222
        ('20', '20'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   223
        ('40', '40'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   224
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   225
OC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   226
        ('email', 'email'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   227
        ('amount', 'amount'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   228
        )
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
IC = (
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   231
        ('Name', 'name'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   232
        ('Email', 'email'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   233
        ('Amount', 'amount'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   234
        ('Organisation', 'organisation'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   235
        ('Conference', 'conference'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   236
        ('Tutorial', 'tutorial'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   237
        ('Sprint', 'sprint'),
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   238
        ('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
   239
        )
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   240
137
ec6e58c639bf Added phone number, modified Occupation to be choice field.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 96
diff changeset
   241
94
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   242
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
   243
    """
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   244
    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
   245
    """
87e77aa18610 Moved the files to new Django app named scipycon and modified settings.
Madhusudan.C.S <madhusudancs@gmail.com>
parents:
diff changeset
   246
    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
   247
        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
   248
    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
   249
        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
   250
    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
   251
        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
   252
    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
   253
        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
   254
    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
   255
        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
   256
    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
   257
        label=u'Include fields')