title: django: request.POST key is empty if the choicefield value is not set
body: <p>I am currently beginning web development using django. In my application, I want a form with a varied number of questions and their choices to be presented. </p>
  
  <p>In <em>models.py</em>, a table is create to store the questions</p>
  
  <pre><code>class QuizItems(models.Model):
      question = models.CharField(max_length=255)
      choices = SeparatedValuesField(token="$")
      answer = models.IntegerField()
  </code></pre>
  
  <p>In <em>form.py</em>, I overload the __init__ method in Form class so as to pass qchoose, a list of QuizItems instances to create the form fields.</p>
  
  <pre><code>def choiceItem(question):
      return [(unicode(idx), q) for idx, q in enumerate(question.choices)] 
  
  class QuizForm(forms.Form):
      def __init__(self, qchoose, *args, **kwargs):
          super(QuizForm, self).__init__(*args, **kwargs)
          for q in qchoose:
              self.fields[str(q.id)] = forms.ChoiceField(required=True,
                label=q.question, widget=forms.RadioSelect(),choices=choiceItem(q))
  </code></pre>
  
  <p>Then in <em>view.py</em></p>
  
  <pre><code>if request.method == 'POST':
      idlst = request.POST.keys()
  else:
      # qchoose is a list of quizitems
      form = QuizForm(qchoose)
  </code></pre>
  
  <p>In <em>quiz.html</em></p>
  
  <pre><code>{% for field in form %}
  &lt;li&gt;&lt;b&gt; {{ field.label }} &lt;/b&gt;&lt;/li&gt;                                                                                                                      
  &lt;ul&gt; {{ field }} &lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>I want to get idlst, the list of question id, that I can get the correct answers from. It works fine when all the choicefields are filled. The problem is if there is any choicefield value is empty, I won't get its key. I think since the request.POST is a dictionary, it is supposed to return all the keys even if its value is empty.<br><br>
  Could anyone help me what is wrong with my code or anything missing? Thank you!</p>