-
Code's Tags
-
Your Codes
-
Reffers
-
Linked Codes
|
Code:
Short link for Twitter:
HTML:
HTML view:
Copy Source | Copy HTML Eg. you have a survey app, and you want a page with all questions from that survey displayed. #IN views.py def survey(request, survey_slug) ... questions = survey.questions.all() question_forms = [] for question in questions: qform = QuestionForm(question=question, prefix = question.slug) question_forms.append(qform) ... if request.method == "POST": for question in questions: qform = QuestionForm(question=question, prefix = question.slug, data = request.POST) #Validate and do save action ... ...
|