This is about issue

http://code.google.com/p/web2py/issues/detail?id=1208

I solved it with this code on gluon/tools.py

        if global_settings.web2py_runtime_gae:
            user = Row(self.db.auth_user._filter_fields(user, id=True))
            delattr(user,'password')
        else:
            user = Row(user)
            for key,value in user.items():
                if callable(value) or key=='password':
                    delattr(user,key)

This has a practical effect that virtual fields will not be saved on 
auth.user on GAE.
There is a bigger issue.

If here are no virtual fields:
            user = Row(self.db.auth_user._filter_fields(user, id=True))
            delattr(user,'password')
and
            user = Row(user)
            for key,value in user.items():
                if callable(value) or key=='password':
                    delattr(user,key)
produce identical user objects. Same type. Same class. Same keys and 
values. Why does the former work on GAE and the latter produces a cPickle 
error when trying to pickle a session (session.auth.user = user)?

Any help will be appreciated.

Massimo



-- 



Reply via email to