title: Django Form setting ChoiceField options as Form is called
body: <p>I'm trying to integrate with an inventory application and allow users to add parts to inventory through a Django form. I can read from the inventory database but have to write through the API so based on what they enter into the a previous form I want to give them a list of available parts to add.</p>
  
  <p>Here is my form, I set a few choices just as a default:</p>
  
  <pre><code>class PartForm(forms.Form):
      PART_CHOICES = (
      ('BT-J1KND-A', 'BT-J1KND-A'),
      ('BT-J1KND-B', 'BT-J1KND-B'),)
      part = forms.ChoiceField(choices = PART_CHOICES,required = True, label = 'Part to add to Inventory')
  </code></pre>
  
  <p>And here is where I set the choices</p>
  
  <pre><code>parts_list = part_sql(part)
  #build choices
  PART_CHOICES= [(p[0],p[0]) for p in parts_list]
  form = PartForm()
  form.fields['part'].choices = PART_CHOICES
  </code></pre>
  
  <p>It displays correctly in the template but when I go to hit save and process the form if it is not one of the default choices I put in it says it is not a valid option.</p>
  
  <pre><code>Select a valid choice. BT-J1KND-C is not one of the available choices.
  </code></pre>
  
  <p>How do I fix this to get it to accept the choices I set as valid options?</p>