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 
>at 
>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.

-- 
Dieter
_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to