Just in case any of you want to do this...I've written a routine that
enables you to save a Query/Expression object in the session.

I have a controller that uses a form to build a relatively complex
query and I want other controllers to use that query to generate
reports and graphs.  I initially explored saving the query in the
session as a string, but it just wasn't working for me so I bit the
bullet and wrote a seralization routine that takes a Query object and
extracts it into a dictionary strucuture.  There's another function
that does the reverse.

It's all here in this slice:
http://www.web2pyslices.com/slice/show/1489/save-query-in-session

It needs more testing for edge cases (I just don't know enough about
the DAL to do all of that).  I've written it as a module, but
ultimately it would be nice to have something like it as a method
within the gluon.dal.Query class itself?  Better yet, get the
framework to automatically invoke it when saving a Query/Expression to
session (like it does for rows).

Reply via email to