the fact that a User class has an attribute "roles" is due to the
mapper placed on the User class, which initializes it with the "roles"
attribute.  if youre using mod_python, its likely using a multi-process
model which can deserialize a User object into a new process where the
owning module has not yet been imported, nor have any mappers been set
up; pickle then imports the module on its own during the load() and is
likely not initializing the mappers.   you need to insure that either
your mod_python process always imports your User class as well as
initilalizes the mappers on it (and calls compile() on at least one of
the mappers) before doing any pickle operations, or that simply
importing User's module will also set up the mappers.

as a test, just write a script that serializes the mapped User to a
file.  then go into a python shell and try to open the file and
pickle.load() it, without any imports.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to