Created
May 28, 2012 19:41
-
-
Save bmease/2820857 to your computer and use it in GitHub Desktop.
got rid of factory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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