I have this form:
class AccountForm(forms.Form):
username = forms.CharField(max_length=100, help_text="Enter Username
of your account", label="Your username")
email = forms.EmailField(max_length=100, help_text="Enter your e-mail
address", label="Your e-mail address")
first_name = forms.CharField(max_length=50, help_text="Enter your
first name(s) and/or initials", label="First name")
last_name = forms.CharField(max_length=50, help_text="Enter your last
name", label="Last name")
pwd = forms.CharField(max_length=100, help_text="Enter your
password", label="Your password")
pwdc = forms.CharField(max_length=100, help_text="Enter your password
again", label="Your password (again)")
def clean(self):
data = self.cleaned_data
if len(data.get("username")) < 4:
raise forms.ValidationError("Username is too short")
if data.get("pwd") != data.get("pwdc"):
raise forms.ValidationError("Passwords do not match")
For some reason the view does not save the stuff i get with form and i
want to figure out why.
Perhaps form does not validate for some reason... Where or how can i
see those validationerrors.. how can i get them appear in view?
Is there a good example about it?
Alan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---