On Sun, 2008-03-02 at 02:04 -0800, Panos Laganakos wrote: > It seems weird, true. It might be my mistake, but I can't seem to > figure it out. Here it is: > > form: > > class CustomerForm(forms.Form): > username = forms.CharField(label=_('Username'), max_length=30) > first_name = forms.CharField(label=_('First name'), max_length=30) > last_name = forms.CharField(label=_('Last name'), max_length=30) > email = forms.EmailField(label=_('Email) > ... > > ---- > view: > > def customer(request): > if request.method is 'POST': > form = CustomerForm(request.POST) > else: > form = CustomerForm() > ... > return render_to_response('customer.html', {'form': form}, > context_instance=RequestContext(request))
You have to call is_valid() on the form for the error checking and cleaning to be done. It doesn't make sense to just redisplay the form without doing any error checking, since if there are no errors, you'll want to display some other page. Malcolm -- The cost of feathers has risen; even down is up! http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---