[Zope3-Users] Re: Compound Form Elements

James Allwyn jamesallwyn at gmail.com
Thu Oct 6 14:25:44 EDT 2005


Thanks for the tips.

> I may be forgetting something here... but this should certainly give
> you a head start. There's a bunch of very good information on this in
> these files:
>
> zope/app/form/browser/widgets.txt
> zope/app/form/browser/objectwidget.txt
>
> Hmmm, looking through these again, these are really good examples. Pay
> more attention to them than to what I wrote above ;-)


I've tried making the poll demo as described in widgets.txt to get the
hang of this, but unfortunately it doesn't seem to work. When I try to
restart zope it give the following error:

    ZopeXMLConfigurationError: File "C:\Python24\Lib\site-packages\zope\app\demo
\poll\configure.zcml", line 5.4-6.47
    ConfigurationError: ('Unrecognized parameters:', 'permission')

The relevant section of the configure.zcml file reads:

    <factory id="zope.app.demo.poll"
             permission="zope.ManageContent" />

Removing the permission section brings up an error further on in the config:

    ZopeXMLConfigurationError: File "C:\Python24\Lib\site-packages\zope\app\demo
\poll\configure.zcml", line 53.4-59.10
    ConfigurationError: ('Unrecognized parameters:', 'content_factory')

which refers to a section that reads:

    <browser:addMenuItem
        title="Poll Demo"
        description="Poll Demo"
        content_factory=".poll.Poll"
        view="AddPoll.html"
        permission="zope.ManageContent"
        />

Removing the content_factory line raises an error along the lines of
"must specify either a factory or a class". Changing it to read:

        class=".poll.Poll"

allows Zope to start up, but when I click on the "Poll Demo" add menu
item that appears it raises "System Error". From the traceback:


Exception Value
__init__() takes at least 4 arguments (3 given)

(full traceback below)

I'm pretty sure I've copied and pasted all the sections of the demo
from the widgets.txt file into the right files, but I could have done
something else stupid. Or is there something genuinely amiss with the
demo?

Any thoughts?

Thanks,
James










Traceback (innermost last):

    * Module zope.publisher.publish, line 138, in publish
      result = publication.callObject(request, object)
    * Module zope.app.publication.zopepublication, line 164, in callObject
      return mapply(ob, request.getPositionalArguments(), request)
    * Module zope.publisher.publish, line 113, in mapply
      return debug_call(object, args)
      __traceback_info__: <bound method +.action of
<zope.app.publisher.browser.viewmeta.+ object at 0x02552630>>
    * Module zope.publisher.publish, line 119, in debug_call
      return object(*args)
    * Module zope.app.container.browser.adding, line 128, in action
      name=view_name) is not None:
    * Module zope.component, line 165, in queryMultiAdapter
      return sitemanager.queryMultiAdapter(objects, interface, name, default)
    * Module zope.component.site, line 75, in queryMultiAdapter
      default)
    * Module zope.interface.adapter, line 481, in queryMultiAdapter
      return factory(*objects)
    * Module zope.app.form.browser.editview, line 64, in __init__
      self._setUpWidgets()
    * Module zope.app.form.browser.add, line 49, in _setUpWidgets
      setUpWidgets(self, self.schema, IInputWidget, names=self.fieldNames)
    * Module zope.app.form.utility, line 153, in setUpWidgets
      context=context)
    * Module zope.app.form.utility, line 101, in setUpWidget
      widget = widget(field.bind(context), view.request)
    * Module zope.app.form, line 97, in __call__
      instance = self._widget_factory(*args)

TypeError: __init__() takes at least 4 arguments (3 given)


More information about the Zope3-users mailing list