Skip to content

Instantly share code, notes, and snippets.

@bmease
Created May 28, 2012 19:41
Show Gist options
  • Save bmease/2820857 to your computer and use it in GitHub Desktop.
Save bmease/2820857 to your computer and use it in GitHub Desktop.
got rid of factory
# views.py
def add_tip(request):
if request.method == "POST":
formset = AddTipForm(request.POST)
if formset.is_valid():
formset.save()
else:
formset = AddTipForm()
return render_to_response("tip/add_tip.html", {"formset": formset}, context_instance=RequestContext(request))
# templates/tip/add_tip.html
<form method="post" action="">
{% csrf_token %}
{{ formset }}
<input type="submit" value="submit" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment