title: edit django form with instance always loads with empty form fields
body: <h1>models.py</h1>
  
  <pre><code>class summary_model(models.Model):
      username = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)
      summary=models.TextField(unique=False, blank=False, null=False)
      numberofprojects=models.CharField(max_length=264, unique=False, blank=False, null=False)
      numberofinternships=models.CharField(max_length=264, unique=False, blank=False, null=False)
      numberofjobs=models.CharField(max_length=264, unique=False, blank=False, null=False)
      def __str__(self):
          return str(self.username)
  </code></pre>
  
  <h1>forms.py</h1>
  
  <pre><code>class summary_form(forms.ModelForm):
      #fields from model
      class Meta:
          model = summary_model
          fields = ('summary','numberofprojects','numberofinternships','numberofjobs')
  </code></pre>
  
  <h1>views.py</h1>
  
  <pre><code>def summaryview(request):
      username=request.user
      if request.method == 'GET':
          summaryform=summary_form(request.GET or None,instance=summary_model.objects.get(username=username))
          print(summaryform)
      elif request.method == 'POST':
          form4=summary_form(request.POST or None,instance=summary_model.objects.get(username=username))
          if form4.is_valid():
              summary_obj = form4.save(commit=False)
              summary_obj.username = request.user
              summary_obj.save()
              return redirect('#anotherview')
          else:
              summaryform=summary_form(instance =summary_model.objects.get(username =username))
      return render(request,'app/summary.html',{'summaryform':summary_form,})
  </code></pre>
  
  <h1>template/summary.html</h1>
  
  <pre><code>{% block content %}
  &lt;form action="" method="post" novalidate&gt;
  {% csrf_token %}
  {{ summaryform.non_field_errors }}
  &lt;div class="row form-row bg-white has-shadow"&gt;
    &lt;div class="col-12"&gt;
      &lt;span class="labelspan"&gt;{{ summaryform.summary.label }}&lt;/span&gt;
      {{ summaryform.summary.errors }}
      &lt;span class="inputfieldspan"&gt;{{ summaryform.summary}}&lt;/span&gt;
    &lt;/div&gt;
    &lt;div class="col-6"&gt;
      &lt;span class="labelspan"&gt;{{ summaryform.numberofprojects.label }}&lt;/span&gt;
      {{ summaryform.numberofprojects.errors }}
      &lt;span class="inputfieldspan"&gt;{{ summaryform.numberofprojects}}&lt;/span&gt;
    &lt;/div&gt;
    &lt;div class="col-6"&gt;
      &lt;span class="labelspan"&gt;{{ summaryform.numberofinternships.label }}&lt;/span&gt;
      {{ summaryform.numberofinternships.errors }}
      &lt;span class="inputfieldspan"&gt;{{ summaryform.numberofinternships}}&lt;/span&gt;
    &lt;/div&gt;
    &lt;div class="col-6"&gt;
      &lt;span class="labelspan"&gt;{{ summaryform.numberofjobs.label }}&lt;/span&gt;
      {{ summaryform.numberofjobs.errors }}
      &lt;span class="inputfieldspan"&gt;{{ summaryform.numberofjobs}}&lt;/span&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  {{ summaryform.message.help_text }}
  &lt;button type="submit" class="btn3"&gt;Save and Continue&lt;/button&gt;&lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>i need to take input in summary form and allow user to edit using the same view.when i save the filled data its updating but the main issue is its not populating data in the form from the database using instance.</p>