This should work:

session.form_vars=dict(form.vars)

have you tried it?

On Jan 7, 2:56 pm, johntynan <[email protected]> wrote:
> Thanks Massimo!  This works perfectly.
>
> I have one quick follow up question.
>
> When using the following code:
>
> form=SQLFORM(db.table)
> if FORM.accepts(form,request.vars):
>     session.form_vars=form.vars
>
> as you had suggested here:
>
> http://groups.google.com/group/web2py/browse_thread/thread/b3508f4a9b...
>
> I am able to add the form variables to a session.
>
> However, I would like to now save the form.vars in a session variable
> as a list of dictionaries as well.  Just for grins I tried
>     session.form_vars=list(dict(form.vars))
> do you have any suggestions for how I might get this this to work?
>
> On Jan 5, 7:44 am, mdipierro <[email protected]> wrote:
>
> > The problem is here:
>
> >         organization = db
> > (db.organization.id==session.organization_id).select()
> >         session.organization = organization
>
> > you are storing a Rows object in the session and that should not be
> > done.
> > we manage to make it work (partially) without GAE but the retrieved
> > object is not the same as the original.
> > it does not work on GAE because marshal.dumps does not exist on GAE.
> > If you really need to do this try:
>
> >         organization = db
> > (db.organization.id==session.organization_id).select()
> >         session.organization = organization.as_list()
>
> > it will store the Rows as a list of normal dictionaries.
>
> > On Jan 5, 4:57 am,johntynan<[email protected]> wrote:
>
> > > I have a web2py app that runs well under web2py, as well as within the
> > > GAE development server, however, after updating the app, and then
> > > testing this on the production server here:
>
> > >http://opensourcebroadcasting.appspot.com/pledgedrives/
>
> > > When submitting one specific "session_organization_id_form"
>
> > > I receive the following:
>
> > > AttributeError: 'module' object has no attribute 'dumps'
>
> > > For the full traceback, see:
>
> > >http://pastie.textmate.org/767257.txt
>
> > > The code for the form itself can be found here:
>
> > >http://code.google.com/p/pledgedrivetracker/source/browse/pledgedrive...
>
> > > Any suggestions on what exactly is failing and how this could be
> > > resolved is appreciated.
>
> > > Thanks!
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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