title: Django initiate form fields with model instance
body: <p>I thought it looks trivial, and was surprised.</p>
  
  <h2>What I have</h2>
  
  <p>I have a Django model + form (ModelForm).</p>
  
  <p>My user fills in the form, and on my view I have the usual:</p>
  
  <pre><code>    if request.POST:
          form = myForm(request.POST)
      if request.method == "POST" and form.is_valid():
          result = form.save(commit=False) 
  </code></pre>
  
  <p>Now I need to <em>heavily</em> manipulate some fields of the form (in the "result" object) and I want to check the forms <code>is_valid()</code> again before saving.</p>
  
  <h2>The Problem</h2>
  
  <p>I tried to create a new form using the "result" object (that is a ModelForm object) using a dictionary (as suggested <a href="https://stackoverflow.com/questions/1123337/django-converting-an-entire-model-into-a-single-dictionary">here</a>)</p>
  
  <pre><code>result_dictionary = dict((x.name, getattr(result, x.name)) for x in result._meta.fields) 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>result_dictionary = model_to_dict(result, fields=[field.name for field in result._meta.fields])
  </code></pre>
  
  <p>plus</p>
  
  <pre><code>testForm = myForm(initial=result_dictionary)
  </code></pre>
  
  <p>but it doesn't pass is_valid() <strong>and does'nt give any errors!</strong>
  The fields are passed OK to the new form...</p>
  
  <p>Any ideas?</p>