Johann, you should look at this slice...

http://www.web2pyslices.com/slice/show/1489/save-query-in-session

Does it do what you want?


On Friday, September 7, 2012 12:40:44 AM UTC+12, Massimo Di Pierro wrote:
>
> You cannot store a query in a session. 
>
> On Thursday, 6 September 2012 04:26:57 UTC-5, Johann Spies wrote:
>>
>> I have been using session a lot to store queries.
>>
>> This morning with the following query:
>>
>> (((akb_doccenter.publication_date = '2012') AND (akb_doccenter_category.uuid 
>> = akb_doccenter.category)) AND (akb_doccenter_location.uuid =akb_doccenter
>> .location))
>>
>>
>>
>> I get the following when I try to do 
>> session.query = query
>>
>> Traceback (most recent call last):
>>   File "/home/js/web2py.20120810/gluon/main.py", line 545, in wsgibase
>>     session._try_store_on_disk(request, response)
>>   File "/home/js/web2py.20120810/gluon/globals.py", line 683, in 
>> _try_store_on_disk
>>     cPickle.dump(dict(self), response.session_file)
>>   File "/usr/lib/python2.7/copy_reg.py", line 70, in _reduce_ex
>>     raise TypeError, "can't pickle %s objects" % base.__name__
>> TypeError: can't pickle function objects
>>
>>
>> What is causing this?  What is my alternatives?  Should I rather use 
>> cache?
>>
>> Regards
>> Johann
>>
>

-- 



Reply via email to