I am used to doing things like:
        label for="id_title">Title:</label> {{ form.title }}
        {% if form.username.errors %}
                <span class="error">{{ form.username.errors|join:", " }}</span>
        {% endif %}

so, yeah :/

I thought if the form was bound (ie, in that case request.POST), it
should display the errors by itself.


On Mar 2, 12:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to