title: Django passing object ID in hiddeninput by populating
body: <p>I have an form which allows a user to edit an object description. 
  How can I  populate an  object ID in a form's hidden input value.
  What I done so far is I added an field called hidden_field in forms.py but it only show the hidden_field . How can I link the hidden_field with the object ID</p>
  
  <p>models.py</p>
  
  <pre><code>class School(models.Model):
  
  
      user = models.ForeignKey(User)
      name = models.CharField(max_length=55)
      description = models.CharField(max_length=300,blank=True)
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class SchoolDescriptionForm(forms.ModelForm):
          description = forms.CharField(widget=forms.Textarea,max_length=300)
          hidden_field = forms.CharField(widget=forms.HiddenInput())
      class Meta:
          model = School 
          fields = ()
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def SchoolEditor(request,school_id):
  
  
      school = School.objects.get(pk=school_id,user=request.user)
      form = SchoolDescriptionForm(instance=school) # I want to populate the object ID 
  
      return render(request,'schooleditor.html',{'school':school,'form':form})
  </code></pre>
  
  <p>template</p>
  
  <pre><code> &lt;form method="POST" enctype="multipart/form-data"&gt;
       {% csrf_token %}
      {{ form.as_p }}
  
      &lt;input type = "submit" value= "save" /&gt;
  {{ form.field.as_hidden }}
   &lt;/form&gt;
  </code></pre>