Skip to content

Instantly share code, notes, and snippets.

@shadow-identity
Created September 11, 2013 06:03
Show Gist options
  • Save shadow-identity/6519831 to your computer and use it in GitHub Desktop.
Save shadow-identity/6519831 to your computer and use it in GitHub Desktop.
view
@render_to('hello/requests.html')
def requests(request):
RequestsFormSet = modelformset_factory(Requests, max_num=10, fields=('priority', 'url'))
if request.method == 'POST':
formset = RequestsFormSet(request.POST, request.FILES)
if formset.is_valid():
for form in formset:
form.save()
else:
formset = RequestsFormSet()
# for form in formset:
# print (form.as_table())
return {'formset': formset}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment