field objects cannot be stored in sessions because they contain a
reference to an open database connection. That is not serializable.

On Jul 23, 12:18 am, weheh <[email protected]> wrote:
> I want to create a session variable session.orderby so that later on,
> I can do
>
>     db(query).select(db.table.ALL,orderby=session.orderby)
>
> Problem is, when I set
>
>     session.orderby=db.table.field
>
> I get a ticket:
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\main.py", line 407, in wsgibase
>     session._try_store_on_disk(request, response)
>   File "C:\web2py\gluon\globals.py", line 378, in _try_store_on_disk
>     cPickle.dump(dict(self), response.session_file)
>   File "C:\Program Files\Python25\Lib\copy_reg.py", line 73, in
> _reduce_ex
>     getstate = self.__getstate__
>   File "C:\web2py\gluon\sql.py", line 1611, in __getattr__
>     return dict.__getitem__(self,key)
> KeyError: '__getstate__'
>
> What am I doing wrong?

Reply via email to