Created
March 27, 2018 11:58
-
-
Save bhavaniravi/b784c57ae9d24fce359ae44e2e90b8e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @login_required | |
| def addtoprofile(request, count): | |
| count = int(count) | |
| formsets = (Form1, Form2, Form3) | |
| try: | |
| Form = Form[count] | |
| except IndexError: | |
| return redirect("/") | |
| next_url = "Next" | |
| if count == len(formsets): | |
| return redirect("/") | |
| if request.method == "GET": | |
| return TemplateResponse(request, template, "form":Form()) | |
| if request.method == "POST": | |
| form = Form(request.POST) | |
| if form.is_valid(): | |
| form.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment