taskapp/forms/user.py
author nishanth
Thu, 04 Feb 2010 22:34:22 +0530
changeset 20 ec7b1751c161
parent 13 0fb64b24a1c9
child 23 f33084ea1361
permissions -rw-r--r--
renamed templates/error.html to templates/show_msg.html and made changes accordingly in views/user.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     1
#!/usr/bin/python2.5
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     2
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     3
from django import forms
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     4
from pytask.taskapp.models import GENDER_CHOICES
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     5
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     6
class RegistrationForm(forms.Form):
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     7
    username = forms.CharField(max_length=30, required=True)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     8
    password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
     9
    repeat_password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    10
    email = forms.EmailField(max_length=30, required=True)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    11
    gender = forms.ChoiceField(choices=GENDER_CHOICES, required = True)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    12
    dob = forms.DateField(required=True, help_text = "(YYYY-MM-DD)")
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    13
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    14
class LoginForm(forms.Form):
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    15
    username = forms.CharField(max_length=30, required=True)
0fb64b24a1c9 added views, templates for register, login, logout user.
anoop
parents: 12
diff changeset
    16
    password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)