Skip to content

Instantly share code, notes, and snippets.

@romanbarczynski
Created January 17, 2012 20:31
Show Gist options
  • Save romanbarczynski/1628707 to your computer and use it in GitHub Desktop.
Save romanbarczynski/1628707 to your computer and use it in GitHub Desktop.
def get_form_dict(form):
data = {}
for name, field in form.fields.items():
bf = BoundField(form, field, name)
data[form.add_prefix(name)] = unicode(bf.value() or '')
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment