[ZODB-Dev] AdaptableStorage and ZClass instances

Shane Hathaway shane@zope.com
Wed, 12 Feb 2003 10:15:49 -0500


Rocky Burt wrote:
> Not sure where AdaptableStorage questions/comments should go, but someone 
> suggested this list, so here goes.
> 
> Starting off, I'd like to mention that the default FS mapping doesn't
> allow you to create objects with ID's that start with '.' do to the
> metadata prefix mapping.  I've quietly modifed my own FSConnection to use
> '.__metadata__' as the prefix instead of '.' which works ok, but of course
> I couldn't create a new object with an ID that starts with '__metadata__'.

Starting in version 0.5, you can configure that without changing the 
code.  Use the metadata_prefix and hidden_filenames options when 
creating the storage.

> (note: I couldn't create a plone site on a AS mount point because Plone 
> creates items that start with '.'.  But now it works fine.)
> 
> But, my real issue is that it seems I can't paste in objects that are derived
> from ZClasses.  When I try, I get the following error:
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 98, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 39, in call_object
>   Module OFS.CopySupport, line 159, in manage_pasteObjects
>   Module Products.AdaptableStorage.patches, line 58, in _getCopy
>   Module Products.AdaptableStorage.zodb.utils, line 45, in copyOf
> ImportError: No module named *toMgfZwMlJlaeWGbeSiFQw==
> 
> After some debugging, this seems to be a unpickling error.  Anyone have
> any suggestions to fix or work pass this?

I haven't tried ZClass instances with AS yet.  You're fortunate you got 
that far. :-)  I guess the copyOf() function needs to know about custom 
class loaders.  My inclination is to say we should set the find_global 
handler of the unpickler.

Shane