<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>formfield_errors &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/formfield_errors/</link>
	<description>Feed of posts on WordPress.com tagged "formfield_errors"</description>
	<pubDate>Tue, 08 Dec 2009 09:50:46 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Making a complex customized Django form template? Remember to include form.non_field_errors!]]></title>
<link>http://kfarr.com/2008/04/04/making-a-complex-customized-django-form-template-remember-to-include-errorsnon_field_errors/</link>
<pubDate>Sat, 05 Apr 2008 07:56:05 +0000</pubDate>
<dc:creator>kfarr</dc:creator>
<guid>http://kfarr.com/2008/04/04/making-a-complex-customized-django-form-template-remember-to-include-errorsnon_field_errors/</guid>
<description><![CDATA[This drove me crazy for about 30 minutes. If you&#8217;re making a heavily customized form template ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This drove me crazy for about 30 minutes.</p>
<p>If you&#8217;re making a heavily customized form template with Django, the <a href="http://www.djangoproject.com/documentation/newforms/#complex-template-output">newforms documentation</a> suggests this format:</p>
<p><a href='http://kfarr.wordpress.com/files/2008/04/django-code-custom-form.png'><img src="http://kfarr.wordpress.com/files/2008/04/django-code-custom-form.png" alt="" class="alignnone size-full wp-image-298" /></a></p>
<p>But, if you do any sort of non-field specific (form-level) validation, those validation messages won&#8217;t be returned to the user. So, instead of seeing a message like, &#8220;Both password fields must match,&#8221; the form just reloads without a explanation, confusing our poor end-users (and me for about 30 minutes)! </p>
<p>A quick #django IRC session later and I had the answer: <code>form.non_field_errors</code></p>
<p>This did the trick for me:<br />
<a href='http://kfarr.wordpress.com/files/2008/04/django-non-field-errors.png'><img src="http://kfarr.wordpress.com/files/2008/04/django-non-field-errors.png" alt="" class="alignnone size-full wp-image-299" /></a></p>
<p>I&#8217;m no professional developer, but a lack of Google search results for this matter inspired me to make a quick post and tag it well so future Django form template customizers don&#8217;t pull their hair out.</p>
<p>(Sorry to post the code as images, but [hosted] WordPress doesn&#8217;t escape HTML enclosed in code blocks! Ridiculous.)</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
