author | nishanth |
Thu, 04 Feb 2010 23:24:20 +0530 | |
changeset 29 | 8baf12083a1e |
parent 27 | 8d52492d3c14 |
child 40 | 43853e376bb8 |
permissions | -rw-r--r-- |
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 |
23 | 4 |
from pytask.taskapp.models import GENDER_CHOICES, Profile |
5 |
from django.forms import ModelForm |
|
13
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
6 |
|
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
7 |
class RegistrationForm(forms.Form): |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
8 |
username = forms.CharField(max_length=30, required=True) |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
9 |
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 |
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
|
11 |
email = forms.EmailField(max_length=30, required=True) |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
12 |
gender = forms.ChoiceField(choices=GENDER_CHOICES, required = True) |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
13 |
dob = forms.DateField(required=True, help_text = "(YYYY-MM-DD)") |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
14 |
|
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
15 |
class LoginForm(forms.Form): |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
16 |
username = forms.CharField(max_length=30, required=True) |
0fb64b24a1c9
added views, templates for register, login, logout user.
anoop
parents:
12
diff
changeset
|
17 |
password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput) |
23 | 18 |
|
19 |
class UserProfileEditForm(ModelForm): |
|
20 |
class Meta: |
|
21 |
model = Profile |
|
22 |
exclude = ('user','rights','dob','credits') |