Brad Clements wrote at 2004-7-19 11:26 -0400:
>Can sessions store instance objects created by an external method?

It can provided they are picklable...

> ...
>  Module ZODB.Connection, line 416, in commit
>   - __traceback_info__: (('Products.Transience.TransientObject', 'TransientObject'), 
>'\x00\x00\x00\x00\x00\x00\x00%', '')
>UnpickleableError: Cannot pickle <extension class Acquisition.ImplicitAcquirerWrapper 
>409d7800> objects

Acquisition wrappers are not picklable.

>My external method looks like this::
>def CreateInstanceItem(**kw):
>    """Generate an instance item"""
>    return InstanceItem(**kw)

This does not return a wrapped instance.

> ...
>I = container.CreateInstanceItem(userid=userid,..., user=user, ...)
> ...
>SESSION['user_details'] = I
>It seems like the 'I' object is wrapped somehow.

Your "I" is not wrapped. The problem must be somewhere else.

Almost surely, the problem is the passed in "user" object which
is an acquisition wrapper and therefore cannot be pickled.

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to