Skip to content

Instantly share code, notes, and snippets.

@CapnKernel
Created July 13, 2013 01:49
Show Gist options
  • Select an option

  • Save CapnKernel/5989058 to your computer and use it in GitHub Desktop.

Select an option

Save CapnKernel/5989058 to your computer and use it in GitHub Desktop.
def customer_choice_list():
customers = list((c.id, c.name) for c in Customer.objects.order_by('id'))
return customers
class NewOrChangeOrderForm(forms.Form):
customer = forms.ChoiceField(choices=customer_choice_list())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment