私は器用さのコンテンツオブジェクトの操作についてのチュートリアルに従っています。オブジェクトの作成方法について説明します。
from zope.component import createObject
context = createObject('example.type')
しかし、代わりに何を置くべきかわかりませんexample.type
。IProduct
、、degu.product.IProduct
を使ってみdegu.Product
ました。しかし、それらはすべてComponentLookupErrorを発生させます。
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/daniel/.buildout/eggs/zope.component-3.9.5-py2.6.egg/zope/component/_api.py", line 220, in createObject
return getUtility(IFactory, __factory_name, context)(*args, **kwargs)
File "/home/daniel/.buildout/eggs/zope.component-3.9.5-py2.6.egg/zope/component/_api.py", line 169, in getUtility
raise ComponentLookupError(interface, name)
ComponentLookupError: (<InterfaceClass zope.component.interfaces.IFactory>, 'degu.commerce.product.IProduct')