pytask/taskapp/forms/user.py
author nishanth
Fri, 29 Jan 2010 23:34:19 +0530
changeset 10 c2001db39937
parent 6 94136f9a48bc
child 16 d57e63325759
permissions -rw-r--r--
renamed users.py to user.py and tasks to task in views folder and updated urls.py accordingly .
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     1
#!/usr/bin/python2.5
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     2
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     3
from django import forms
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     4
from pytask.taskapp.models import GENDER_CHOICES
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     5
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     6
class RegistrationForm(forms.Form):
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     7
    username = forms.CharField(max_length=30, required=True)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     8
    password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
     9
    repeat_password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    10
    email = forms.EmailField(max_length=30, required=True)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    11
    gender = forms.ChoiceField(choices=GENDER_CHOICES, required = True)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    12
    dob = forms.DateField(required=True, help_text = "(YYYY-MM-DD)")
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    13
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    14
class LoginForm(forms.Form):
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    15
    username = forms.CharField(max_length=30, required=True)
94136f9a48bc added login, logout, and register.
anoop
parents: 5
diff changeset
    16
    password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)