Thank you. wud try copying into session variables. :)

On May 4, 1:19 am, Yarko Tymciurak <[email protected]> wrote:
> The thing to be aware of:
>
> www is connectionless;  each request is it's own "program" running (sort of
> - it's its own thread).
>
> That is, when you ask for a page, a new instance of web2py is created
> (cache), the application and controller that is being requested is
> determined, the models are read into the thread so that the data structures
> for your datastore are defined (actually, all the files in your app/models
> directory are run, so you may find some opportunistic placement of utilities
> into the models directory by some - this is ok)...  and once that
> environment is setup for the thread, the function from the controller is
> called.
>
> You have a few ways to communicate information between these threads:
>
> - store in persistent data, and let each thread read it out;
> - pass in parameters to your controller/function call
>      See the URL function: you'll see all paths to web2py apps have the form
> of:
>      - application/controller/function/arg/arg2/.../vars
>     the last piece looking like a dict:
> ....arg/arg2?key=value,key2=another_value
> - store in session variables (short term, and works for the same client
> session)
>
> On Sun, May 3, 2009 at 12:53 PM, newbie <[email protected]> wrote:
>
> > hi mdipierro,
>
> >       Actually I'm trying to access some of the request variables of
> > the form. But If i redirect using
>
> >        redirect(URL(r=request,f='confirm'))
>
> >      I'm not able to access the request variables of the form.
>
> > On May 3, 7:03 pm, newbie <[email protected]> wrote:
> > > thanks for the immediate reply :)
>
> > > On May 3, 7:01 pm, mdipierro <[email protected]> wrote:
>
> > > > def page1():
> > > >    form=SQLFORM(db.a_table)
> > > >    if FORM.accepts(form,request.vars):
> > > >         session.vars=form.vars
> > > >         redirect(URL(r=request,f='confirm'))
> > > >    return dict(form=form)
>
> > > > def confirm():
> > > >    form=FORM('sure?',INPUT(_name='yes',_type='checkbox'),INPUT
> > > > (_type='submit'))
> > > >    if request.vars.yes and session.vars:
> > > >         db.a_table.insert(**session.vars)
> > > >         ... do something
> > > >    return dict(form=form)
>
> > > > On May 3, 8:50 am, Nazgi <[email protected]> wrote:
>
> > > > > Hi,
>
> > > > >       I'm new to python and web2py. I have a simple doubt. I've
> > > > > written a form and after the submit button is pressed in the form,  I
> > > > > want to print the variables of the form into next page and ask for
> > > > > confirmation. I have written the form in a controller and also the
> > > > > function for the next page where the variables of the form are
> > > > > printed. But i dont know how to direct to that page after pressing of
> > > > > the submit button. Can someone help me regarding this.
>
> > > > > regards,
> > > > > Nazgi
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to