I think I understand now. you do not need to worry about use of sessions. I think the issue is that you did not write a view "default/ show_form.html" for your action yet so you are getting the "generic.html" one by default.
This view includes the session variables for debugging purposes. If you click on the [session] button it will show it to you. If you make a custom view, the session variables will not be stored in the page. Massimo On 21 Apr, 09:50, Jose <[email protected]> wrote: > On 21 abr, 11:16, mdipierro <[email protected]> wrote: > > > > > I understand what you say but to me your form below shows (as it > > should be) > > > <div><table><tr><td><b><div>form</div></b></td><td align="top">:</ > > td><td><div><form action="" enctype="multipart/form-data" > > method="post">Question:<input name="name" /><input type="submit" /><div > > class="hidden"><input name="_formkey" type="hidden" > > > value="5817fd21-660c-4004-8d52-3f4b700af1f9" /><input name="_formname" > > type="hidden" value="default" /></div></form></div></td></tr></table></ > > div> > > > It does not show the answers. > > > I cannot reproduce your problem. > > > Can you email me a minimalist app that exhibit the problem? > > > If you modify a SQLFORM using append and insert it is possible that > > weird things happen. > > > Massimo > > Massimo > > Already I found the problem. It is for the use of session. If I do not > use session.tch the answers they do not travel to the browser of the > client. > > def show_form(): > # With this yes the answers travel > #if session.tch == None: > # session.tch = ('Question:', > ['Answers1','Answers2','Answers2']) > #tch = session.tch > > #With this the answers do not travel. > tch = ('Question:',['Answers1','Answers2','Answers2']) > form = FORM(tch[0], > INPUT(_name='name',requires=[IS_IN_SET(tch[1])]), > INPUT(_type='submit')) > > if form.accepts(request.vars,session): > #session.tch = None > redirect(URL(r=request,f='index')) > > return dict(form=form) > > The problem that I have in the real case, is that when I do a submit > it calls again get_tch () and it loads a new question-answers. It is > because of it that I used the object session. > > form=SQLFORM(db.my_table) > if session.tch == None: > session.tch = textchas.get_tch() > > tch = session.tch > > I will look for another way without using session. > Thank you very much. > Regards > Jose --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

