On Wed, May 5, 2010 at 6:04 PM, mhulse <rgmi...@gmail.com> wrote:

>                if form.is_valid(): # All validation rules pass.
>
>                        # Q objects/pagination here...
>
>                else:
>
>                        form = SearchForm()
>


form.is_valid() is what annotates the existing form with error information
in the case where there are errrors. However, if form.is_valid() returns
False, the code here immediately overwrites the existing (now annotated with
error information) form and replaces it with a newly-created blank form, so
there will be no errors for the template to display. Get rid of that else
leg.

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to