6
|
1 |
#!/usr/bin/python2.5
|
|
2 |
|
|
3 |
from django import forms
|
16
|
4 |
from pytask.taskapp.models import GENDER_CHOICES, Profile
|
|
5 |
from django.forms import ModelForm
|
6
|
6 |
|
|
7 |
class RegistrationForm(forms.Form):
|
|
8 |
username = forms.CharField(max_length=30, required=True)
|
|
9 |
password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
|
|
10 |
repeat_password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
|
|
11 |
email = forms.EmailField(max_length=30, required=True)
|
|
12 |
gender = forms.ChoiceField(choices=GENDER_CHOICES, required = True)
|
|
13 |
dob = forms.DateField(required=True, help_text = "(YYYY-MM-DD)")
|
|
14 |
|
|
15 |
class LoginForm(forms.Form):
|
|
16 |
username = forms.CharField(max_length=30, required=True)
|
|
17 |
password = forms.CharField(max_length=60, required=True, widget=forms.PasswordInput)
|
16
|
18 |
|
|
19 |
class UserProfileEditForm(ModelForm):
|
|
20 |
class Meta:
|
|
21 |
model = Profile
|
|
22 |
exclude = ('user','rights','dob','credits')
|