Skip to content

Instantly share code, notes, and snippets.

@mitjap
Created September 27, 2012 06:00
Show Gist options
  • Save mitjap/3792437 to your computer and use it in GitHub Desktop.
Save mitjap/3792437 to your computer and use it in GitHub Desktop.
class LocationsForm(forms.Form):
locations = forms.ChoiceField(choices=locationsChoices(), label='', required=False)
def locationsChoices():
return itertools.chain((('', _("Don't mock location")),(("%s-%s" % (backend.get_full_name(), node.id), node.name) for backend, node in nodes.get_all_nodes_with_backends())))
@mitjap
Copy link
Author

mitjap commented Sep 27, 2012

File "/home/mitjap/Projects/issue/PiplMesh/piplmesh/frontend/forms.py", line 18, in
class LocationsForm(forms.Form):
File "/home/mitjap/Projects/issue/PiplMesh/piplmesh/frontend/forms.py", line 20, in LocationsForm
locations = forms.ChoiceField(choices=locationsChoices(), label='', required=False)
NameError: name 'locationsChoices' is not defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment