title: Django: how to display form errors for each model object
body: <p>views.py</p>
  
  <pre><code>def add_phone(request):
      user=request.user
      try:
          phone = Phone_info.objects.get(user=request.user)
      except:
          phone = None
      save_msg = ''
      form_error = False
      phoneForm = PhoneForm({'user':request.user})
      phoneForm = PhoneForm(instance=phone)
      if request.method=='POST':
          phoneForm = PhoneForm(request.POST,instance=phone)    
          if phoneForm.is_valid():
              phone=phoneForm.save(commit=False)
              phone.user = user
              phone.save()
              save_msg = "Your details have been saved"
  
  
      return render_to_response('incident/add_phone.html',
      {
      'about_menu': True,
      'PhoneForm' :phoneForm,
      'save_msg':save_msg,
      'form_error':form_error,
      },
      context_instance=RequestContext(request))
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class PhoneForm(forms.ModelForm):
      emergency = forms.CharField(required=True)
      emergency_number = forms.IntegerField(required=True)
      class Meta:
          model = Phone_info
          fields = ['name1','number1','name2','number2','name3','number3','emergency','emergency_number']
  
  
  def clean(self):
      name1 = self.cleaned_data.get("name1", None)
      number1 = self.cleaned_data.get("number1", None)
      name2 = self.cleaned_data.get("name2", None)
      number2 = self.cleaned_data.get("number2", None)
      name3 = self.cleaned_data.get("name3", None)
      number3 = self.cleaned_data.get("number3", None)
      if name1 and not number1:
          raise forms.ValidationError("This field is required")
      if number1 and not name1:
          raise forms.ValidationError("This field is required")
      if name2 and not number2:
          raise forms.ValidationError("This field is required")
      if number2 and not name2:
          raise forms.ValidationError("This field is required")
      if name3 and not number3:
          raise forms.ValidationError("This field is required")
      if number3 and not name3:
          raise forms.ValidationError("This field is required")
  
      return self.cleaned_data
  </code></pre>
  
  <p>template.html</p>
  
  <pre><code>&lt;table width="100%"  cellpadding="0" cellspacing="0" id="phone"&gt;
  
                  &lt;tr&gt;
                      &lt;td colspan="2"&gt;&lt;h1 align="left"&gt;Call - default telephone numbers&lt;/h1&gt;        &lt;/td&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;Person or area&lt;/td&gt;
                      &lt;td&gt;Phone number&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;{{ PhoneForm.name1 }}{{ PhoneForm.name1.errors }}&lt;/td&gt;
                      &lt;td&gt;{{ PhoneForm.number1 }}{{ PhoneForm.number1.errors }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ PhoneForm.name2 }}{{ PhoneForm.name2.errors }}&lt;/td&gt;
                      &lt;td&gt;{{ PhoneForm.number2 }}{{ PhoneForm.number2.errors }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{PhoneForm.name3}}{{ PhoneForm.name3.errors }}&lt;/td&gt;
                      &lt;td&gt;{{PhoneForm.number3}}{{ PhoneForm.number3.errors }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;Emergency&lt;/td&gt;&lt;td&gt;Phone number&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;{{ PhoneForm.emergency }}{{ PhoneForm.emergency.errors }}&lt;/td&gt;
                      &lt;td&gt;{{ PhoneForm.emergency_number }}{{ PhoneForm.emergency_number.errors }}&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;&lt;td colspan="2" align="right"&gt; &lt;p style=margin-top:2cm;&gt;{% include "buttons/save.html" %}&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
  
              &lt;/table&gt;&lt;/form&gt;
  </code></pre>
  
  <p>It is not throwing the individual error message of form validation.I am using PhoneForm and for individual field,individual error message should occur.I checked it,i am not able to find what i missing.It may be silly Need  help to fix.</p>
  
  <p>Thanks</p>