In trying to work through the PvW book, I get stuck in chapter 7, 2nd part, where the _javascript_/widgets are being introduced. After switching to SequenceWidget, I get to the same behavior/error as in below email but have not been able to find a reply on this email.

I've tried both  Zope-3.2.2 and Zope-3.3.0 with Python 2.4.3 on Mac OS 10.4.8. I can't get  Zope3.x.x to build/work with Python-2.5.

1) Zope catches an exception in zope.app.publish. Right now I am ignoring this.
Object: <zope.app.folder.folder.Folder object at 0x2a381b0>, name: u'favicon.ico' )

2) The errata for the PvW book does suggest a fix (for Zope-3.2 at least, defining def __init__), but that does not help.

Thanks a lot,

Re: [Zope3-Users] worldcookery.browser.widget.DynamicSequenceWidget

Marco Mariani
Tue, 21 Mar 2006 02:57:47 -0800

Ulrich P. Klein wrote:
How should I modify the custom widget in the recipe examples to make it
work with 3.2.0 ?
As it is, the program does not work from chapter 7 onward

I get this on zope.app.form.browser.SimpleInputWidget at every attempt to
display the widget:

    instance = self._widget_factory(*args)
TypeError: __init__() takes exactly 4 arguments (3 given)

--- browser/widget.py.orig 2004-07-10 17:59:36.000000000 +0200 +++ browser/widget.py 2006-03-19 18:28:16.000000000 +0100 @@ -1,9 +1,9 @@ from zope.app import zapi from zope.app.form.interfaces import IInputWidget -from zope.app.form.browser.widget import SimpleInputWidget +from zope.app.form.browser.sequencewidget import SequenceWidget from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile -class DynamicSequenceWidget(SimpleInputWidget): +class DynamicSequenceWidget(SequenceWidget): """Widget for (simple) sequences that does not require the form to be reloaded for every change."""

Close, but it still doesn't work.
The widget is displayed and works on the client, but I am unable to insert ingredients. Every time I click 'add' on the form, the ingredients list comes back empty and the recipe is refused (an error occured; there are 1 input errors).
Zope3-users mailing list

Reply via email to