You cannot store a any SQLxx object in the session. For example a user object. The reason is that user has a method user.update_record which requires a db connection and it is not serializable.
On Oct 26, 7:20 am, pedro <[EMAIL PROTECTED]> wrote: > Hi there. > I am getting an error whose trace has no reference to any point of my > code... > Here's the trace: > > Traceback (most recent call last): > File "/home/p/Desktop/web2py/gluon/main.py", line 210, in wsgibase > File "/home/p/Desktop/web2py/gluon/globals.py", line 203, in > _try_store_on_disk > File "/usr/lib/python2.5/copy_reg.py", line 73, in _reduce_ex > getstate = self.__getstate__ > File "/home/p/Desktop/web2py/gluon/sql.py", line 250, in __getattr__ > KeyError: '__getstate__' > > And here's the two possible spots that can be causing this error, > It's a form processing: > > ==================================================== > if authenticate_user(request.vars.username,request.vars.password): > aut_data = session.user > response.flash = "dados enviados!" > =================================================== > > the function authenticate_user as is so far: > > =================================================== > def authenticate_user(username, password): > user = db(db.users.username==username).select() > if len(user) != 1: > return False > else: > session.user = user[0] > return True > ===================================================== > > Any tips --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

