title: How to grab data from fields in the model and populate them to a django form
body: <p>I'm currently constructing a create layout page for users to input values and use within a template. My problem right now is in my view function I can't get the field data out of the model and repopulate it into a django form. I want only 1 data entry for the Layout model that is always grabbed and put into the form so the user can edit then resave it. This issue will reside in the View.py. Here is what i have:</p>
  
  <p><strong><em>View.py:</em></strong></p>
  
  <pre><code>def create_layoutform(request, template_name='layout/create.html'):
      if len(Layout.objects.all()) &gt; 0:
          # if you have a form, load it
          MyLayout = Layout.objects.get(pk=1)
          LayoutUpdateForm = LayoutForm(MyLayout)    
  
          tmpl_vars = {
              'layoutupdateform':LayoutUpdateForm,
          }
          return render(request, template_name, tmpl_vars)
      else:
          layout_form = LayoutForm(request.POST or None)
          layout = layout_form.save(commit=False)
          layout.save()
          tmpl_vars = {
              'layoutform':layout_form,
          }
          return render(request, template_name, tmpl_vars)
  </code></pre>
  
  <p><strong>My print output for the view: Layout.objects.get(pk=1)</strong></p>
  
  <p><strong>Grabs just the name of the model (Layout object)</strong></p>