Thanks for the information. Unfortunately, in my case I really do need to store the raw query in the session...and then convert it back to a Query so I can then add a few more filters before the final select(). Has anyone managed to store a representation of a query in the session?
On Mar 24, 11:09 am, Anthony <abasta...@gmail.com> wrote: > On Friday, March 23, 2012 5:36:28 PM UTC-4, monotasker wrote: > > > I may be off target but I just recently noticed the .as_dict() method for > > rows objects. This converts the rows object to a regular dict (instead of a > > gluon storage object) which can be stored in session or cache (i.e., it's > > picklable). If you need the query (not the resulting rows object) to be > > stored this doesn't help, but if it works in your case to store the > > select() result this may actually be easier. > > There is also an .as_list() method, which converts to a list of > dictionaries rather than a dictionary of dictionaries. You can also just > store Rows objects directly in the session or cache -- the DAL defines a > reduction function that calls the .as_list() method when a Rows object is > pickled, so you don't have to call the method manually. > > Anthony