[Zope3-Users] z3c.form and subforms in an AddForm?

Stephan Richter srichter at cosmos.phy.tufts.edu
Wed Jul 4 16:39:43 EDT 2007


On Wednesday 04 July 2007 12:59, Matt Bowen wrote:
>   File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
> 1.3.0-py2.4.egg/z3c/form/form.py", line 144, in __call__
>     self.update()
>   File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
> 1.3.0-py2.4.egg/z3c/form/form.py", line 139, in update
>     super(Form, self).update()
>   File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
> 1.3.0-py2.4.egg/z3c/form/form.py", line 88, in update
>     self.updateWidgets()
>   File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form-
> 1.3.0-py2.4.egg/z3c/form/form.py", line 167, in updateWidgets
>     self.widgets = zope.component.getMultiAdapter(
>   File "/opt/zope/zope-3.4.0a1/lib/python/zope/component/_api.py", line
> 103, in getMultiAdapter
>     raise ComponentLookupError(objects, interface, name)
> zope.component.interfaces.ComponentLookupError: ((<
> z3c.pagelet.zcml.NextActionAddForm object at 0x2b69896b4850>, <
> zope.publisher.browser.BrowserRequest instance URL=
> http://localhost:9080/++skin++MovingTargetBrowser/addNextAction.html>, <
> zope.app.folder.folder.Folder object at 0x2b69896eb0c8>), <InterfaceClass
> z3c.form.interfaces.IWidgets>, u'')

This error tells you that the "widget manager" (implementing ``IWidgets``) 
cannot be found for your (form, request, context) discriminator. This can 
really just mean one of the following three things:

1. Your skin "MovingTargetBrowser" does *not* inherit from the ``IFormLayer`` 
skin. Can you show us your skin definition in Python and the registration in 
ZCML?

2. Your form does not provide ``IFieldsForm``. What does the following return?

  >>> from z3c.form import interfaces
  >>> interfaces.IFieldsForm.providedBy(form)

  Can you paste your form Python code and the registration?

3. You did not hook up the ZCML files of z3c.form? Are you sure 
z3c/form/configure.zcml is loaded? This can be checked by causing a syntax 
error in that file and see whether the startup also breaks.

> I keep reading over the .txt files in z3c.form, and I feel like I may be
> missing some line. Do I need a datamanager? My schema is pretty
> straightforward:

No, the data manager and everything else is defined for the common case you 
are having.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list