[Zope3-Users] Re: Utility Local to an Annotation?

Derek Richardson derek.richardson at gatech.edu
Fri Apr 27 19:02:33 EDT 2007


Derek Richardson wrote:
> Benji York wrote:
>> Derek Richardson wrote:
>>> The specific case is uuids for atom feed entries. We have annotations 
>>> representing feeds and I would like my uuid utility to be local to 
>>> the feed annotation, thus recording and making available uuids only 
>>> for entries in that feed.
>>
>> How about a multi-adapter from content and feed to UUID?
> 
> Hmmm, to do that I have to be able to annotate an annotation, right? As 
> the feed is an annotation and that is where I want to store the UUIDs. I 
> tried this tonight and was unable to make it work - I got the following:
> 
> blah, blah, blah
>   File 
> "/Users/dkr/Zope-3.3.1/build/lib.darwin-8.8.1-i386-2.4/zope/security/adapter.py", 
> line 84, in __call__
>     adapter = self.factory(*args)
>   File 
> "/Users/dkr/Zope-3.3.1/build/lib.darwin-8.8.1-i386-2.4/zope/annotation/factory.py", 
> line 38, in getAnnotation
>     annotations = IAnnotations(context)
> TypeError: ('Could not adapt', 
> <plone.syndication.syndication.Syndication object at 0x3741530>, 
> <InterfaceClass zope.annotation.interfaces.IAnnotations>)

I've made it further and am now getting a TraversalError. It seems the 
cause is that the annotation lacks __parent__, so I can't adapt it to 
IAnnotations using:

zope.app.keyreference.persistent.connectionOfPersistent

Any ideas about how I can give a __parent__ to an annotation?

Thanks,

Derek



More information about the Zope3-users mailing list