Django to change form field error message
<p>I have a problem with form errors. I want to change the field name that the form error displays.</p>
<h1>models.py</h1>
<pre><code>class Sales(models.Model):
    customer = models.ForeignKey(&quot;Customer&quot;)
    ctype = models.ForeignKey(&quot;Customer_type&quot;, verbose_name=&quot;Customer Type&quot;)
</code></pre>
<h1>forms.py</h1>
<pre><code>from django.utils.translation import ugettext_lazy as _
class Sales_form(forms.ModelForm):
    class Meta:
        model = Sales
        fields = ('customer','ctype')
        error_messages = {
            'ctype' : {
                'required' : _(&quot;Hey yow! this field is required!&quot;)
            }
        }
</code></pre>
<p>but the error still returns:</p>
<p><strong>{&quot;ctype&quot;: [&quot;Hey yow! this field is required!&quot;]}</strong></p>
<p>What I want is like this</p>
<p><strong>{&quot;Customer Type&quot;: [&quot;Hey yow! this field is required!&quot;]}</strong></p>
<p><a href="http://pastebin.com/w6UkjzHF" rel="nofollow noreferrer">http://pastebin.com/w6UkjzHF</a></p>