title: django hidden field error
body: <p>i'm building a message system for a virtual community, but i can't take the userprofile id</p>
  
  <p>i have in views.py</p>
  
  <pre><code>def save_message(request):
     if request.method == 'POST':
          form = MessageForm(request.POST)
          if form.is_valid():
             new_obj = form.save(commit=False)
             new_obj.sender = request.user
             u = UserProfile.objects.get(request.POST['userprofile_id'])
             new_obj.owner = u
             new_obj.save()
             return HttpResponseRedirect('.')    
     else:
             form = MessageForm()     
     return render_to_response('messages/messages.html', {
             'form': form,
             }, 
            context_instance=RequestContext(request))  
  </code></pre>
  
  <p>and the template:</p>
  
  <pre><code>{% block primary %}
  &lt;form action="." method="post"&gt;
      {{ form.as_p }}
  &lt;p&gt;&lt;input type="hidden" value="{{ userprofile.id }}" name = "owner" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="submit" value="Send Message!" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  {% endblock %}
  </code></pre>
  
  <p>forms.py:</p>
  
  <pre><code>class MessageForm(ModelForm):
      class Meta:
            model = Messages
            fields = ['message']
  </code></pre>
  
  <p>models.py:</p>
  
  <pre><code>class Messages(models.Model):
       message = models.CharField(max_length = 300)
       read = models.BooleanField(default=False)
       owner = models.ForeignKey(UserProfile)
       sender = models.ForeignKey(User) 
  </code></pre>
  
  <p>I don't figure out why i get this error,since i'm just trying to get the profileId of a user, using a hiddeen field.</p>
  
  <p>the error is:</p>
  
  <pre><code>Key 'UserProfile_id' not found in &lt;QueryDict: {u'owner': [u''], u'message': [u'fdghjkl']}&gt;
  </code></pre>
  
  <p>and i'm getting it after i fill out the message text field.
  Thanks!</p>