title: django prepopulate modelform - nothing happens
body: <p>This must be a very simple thing however I can not seem to get through it..</p>
  
  <p>I trying to build a form where the user can update a ModelForm. First he inserts a user id and afterwards I want to show him the form pre-populate with the original data so he can change only the fields that he wants.</p>
  
  <p>After some the help of my friend google, stackoverflow and the django documentation, I've come to this:</p>
  
  <p>views.py  </p>
  
  <pre><code> user = User.objects.get(user_id=usr)  
   if request.method == 'POST':  
        form = TableForm(request.POST)  
        if form.is_valid():  
             #do something  
   else:  
        form = TableForm(instance=user)  
        return render_to_response('template.html',{'form':form})  
  </code></pre>
  
  <p>forms.py   </p>
  
  <pre><code>class TableForm(forms.ModelForm):
       pres_clinic = forms.ModelChoiceField(queryset=PresClinic.objects.all(),
          widget=SelectWithPop(), label=ugettext("Clinic presentation"),
          required=False)
  
       MAYBECHOICES = (
           ('', '---------'),
           (ugettext('Yes'), ugettext('Yes')),
           (ugettext('No'), ugettext('No')))
  
       bcg_scar = forms.ChoiceField(choices=MAYBECHOICES, label=ugettext(
              "BCG scar"), required=False)
       mantoux_register = forms.ChoiceField(choices=MAYBECHOICES,
          label=ugettext("Mantoux register"), required=False)
       date_diag = forms.DateField(widget=DateTimeWidget, label=ugettext(
           "Diagnosis date"), required=False)
       situation = forms.ModelChoiceField(queryset=Situation.objects.all(),
          widget=SelectWithPop(), label=ugettext("Patient status"),
          required=False)
       date_situation = forms.DateField(widget=DateTimeWidget, label=ugettext(
          "Date patient status"), required=False)
  
    class Meta:
      model = Table
      fields = ('pres_clinic', 'bcg_scar', 'mantoux_register',
              'date_diag', 'situation', 'date_situation')
  
  def clean(self):
      cleaned_data = self.cleaned_data
      diag = cleaned_data.get('date_diag')
  
      errors = []
  
      now = datetime.date.today()
  
      if diag is not None and diag != u'':
          if diag &gt; now:
              errors.append(ugettext('The field "Diagnosis date" should be '
                  'smaller than the actual date'))
      if errors:
          raise ValidationError(errors)
  
      return cleaned_data
  </code></pre>
  
  <p>template:  </p>
  
  <pre><code> {{ form }} # presents the empty form and not the data from that user  
  </code></pre>
  
  <p>The version of django is 1.4</p>
  
  <p>Can anyone tell me what is wrong and why I'm not able to see the form populated?</p>
  
  <p>Thank you very much </p>