title: Which is the simplest way to define a dropdown box in Django?
body: <p>I have a simple <code>table</code>, with 2 fields, <code>code</code> and <code>description</code>, and I need to generate a dropdown box on the table's values in <code>Django</code>.</p>
  <p>I want to display the <code>description</code>, but the selection to be done on the <code>code</code> value instead.
  Is it possible to do this in a simple way? The <code>to_field_name</code> doesn't seem to help me too much.</p>
  <pre><code>class ChoiceTest (forms.Form):  
      field_cd1 = forms.ModelChoiceField(queryset=ViewChoiceTest.objects.values_list(“**code**&quot;, flat=True), to_field_name=**description**, label=&quot;Choice &quot;, required=False)
  </code></pre>