[Zope3-Users] EditForm fails in SiteManager because of containment constraint

Christophe Combelles ccomb at free.fr
Sat Apr 7 12:06:54 EDT 2007


Hello,

I have a regular content object which uses the formlib for its edit view.
Nothing special, just like a Recipe.
But I want this object to only reside in the Site Manager, because it will be 
used as a configurable local utility (some kind of LocalKitchenTools utility)

Everything is perfect, and the EditForm works well until I want to tell this 
object to be only contained in the SiteManager. So I just add this statement in 
the interface:

containers(ILocalSiteManager)
or
containers(ISiteManagementFolder)

When I do any of these, the EditForm fails with a ComponentLookupError
What Am I missing? Why does a simple constraint create an error on this?

Christophe


------------------------------------
  Error object: ((<zope.schema._bootstrapfields.Field object at 0xb58a9bec>, 
<zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++lang++en/++skin++Debug/testsite/++etc++site/default/ppp/@@edit.html>), 
<InterfaceClass zope.app.form.interfaces.IInputWidget>, u'')

       File "/usr/lib/python2.4/site-packages/zope/publisher/publish.py", line 
133, in publish
     result = publication.callObject(request, obj)

       File 
"/usr/lib/python2.4/site-packages/zope/app/publication/zopepublication.py", line 
161, in callObject
     return mapply(ob, request.getPositionalArguments(), request)

       File "/usr/lib/python2.4/site-packages/zope/publisher/publish.py", line 
108, in mapply
     return debug_call(obj, args)

       File "/usr/lib/python2.4/site-packages/zope/publisher/publish.py", line 
114, in debug_call
     return obj(*args)

       File "/usr/lib/python2.4/site-packages/zope/formlib/form.py", line 769, 
in __call__
     self.update()

       File "/usr/lib/python2.4/site-packages/zope/formlib/form.py", line 732, 
in update
     self.setUpWidgets()

       File "/usr/lib/python2.4/site-packages/zope/formlib/form.py", line 802, 
in setUpWidgets
     adapters=self.adapters, ignore_request=ignore_request

       File "/usr/lib/python2.4/site-packages/zope/formlib/form.py", line 393, 
in setUpEditWidgets
     widget = _createWidget(form_field, field, request, iface)

       File "/usr/lib/python2.4/site-packages/zope/formlib/form.py", line 323, 
in _createWidget
     return component.getMultiAdapter((field, request), iface)

       File "/usr/lib/python2.4/site-packages/zope/component/_api.py", line 103, 
in getMultiAdapter
     raise ComponentLookupError(objects, interface, name)




More information about the Zope3-users mailing list