Hello,
In my project, I need the users to be able to fill surveys. Right now,
I have added 2 methods to my root.py controller file: fill_survey and
new_answer because I have decided to go question by question (the user
answers the first question, clicks the 'submit' button, then the page
displays the second question, and so forth...) and not by displaying
all the questions at once for I'm still unsure how to handle that.
So the first method (fill_survey) corresponds to the page that
displays the question. It is linked to a template, which displays the
question as a <form> tag whose 'action' attribute is set to the method
'new_answer'. The latter basically writes the answer to the database
and then redirects the user to a new 'fill_survey' page displaying the
next question. I hope I've made myself clear.
Now here's my problem. The 'new_answer' method needs to "know" which
question the user has just answered in order to "tell" the
'fill_survey' method to display the next question. That information is
included in the previous 'fill_survey' method (that called our
'new_answer' method) and in the template file, but there is no way I
can send it to the 'new_answer' method from the template or from the
'fill_survey'.
The redirect instruction enables me to pass parameters to the
specified method, for example
redirect('fill_survey', question=...,....)
But I can't find a way to do the same thing with the 'action'
attribute of <form>.
What do you think ?
Thank you,
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.