[Zope3-Users] Error in annotations example

Zanotti Michele Michele.Zanotti at apss.tn.it
Fri Jun 8 12:01:15 EDT 2007


Hi,
I am reading about annotations in "web component development with zope
3", but I have an error in the following interactive interpreter session
that I don't understand.

PythonWin 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
on win32. Portions Copyright 1994-2006 Mark Hammond - see 'Help/About
PythonWin' for further copyright information.
>>> class Recipe(object):
... 	pass
... 
>>> meatloaf=Recipe()
>>> from zope.annotation.interfaces import IAnnotations
>>> from zope.interface import alsoProvides
>>> from zope.annotation.interfaces import IAttributeAnnotatable 
>>> alsoProvides(meatloaf, IAttributeAnnotatable)
>>> annotations=IAnnotations(meatloaf)
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: ('Could not adapt', <__main__.Recipe object at 0x00D5F570>,
<InterfaceClass zope.annotation.interfaces.IAnnotations>)
>>> 

Excuse me if the question is trivial, but where I'm wrong? Thanks 
Michele


More information about the Zope3-users mailing list