Ron Bickers wrote:
> On Wed May 24 2006 07:00, Martijn Faassen wrote:
> 

> An IItem interface and a class Item implementation that's attribute 
> annotatable.
> 
> The annotation interface and class are as follows:
> 
> class IItemMiscInfo(Interface):
> 
>     inStock = Bool(
>         title=u"In Stock",
>         description=u"Is item in stock?",
>         default=True)
> 
> class ItemMiscInfo(Persistent):
>     implements(IItemMiscInfo)
>     adapts(IItem)
> 
>     def __init__(self):
>         self.inStock = True
> 
> What am I supposed to use in the adapter directive as the factory?  If I 
> put ".item.ItemMiscInfo", I get "TypeError: Missing 'provides' attribute" 
> when starting Zope.  If I add provides=".interfaces.IItemMiscInfo", I get 
> the following error when trying to access the editform:
> 
>   File "/usr/lib/zope-3.3.0_beta1/lib/python/zope/security/adapter.py", line 
> 84, in __call__
>     adapter = self.factory(*args)
> TypeError: __init__() takes exactly 1 argument (2 given)


I haven't been following this thread, however from the error message it
appears your adapter is missing the context (adaptee)...

      def __init__(self, context):
         # context is the IItem object to be adapted.



_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to