Re: [Zope3-Users] Problem running examples from Zope3 book Weiterhausen

2006-03-19 Thread Ulrich P. Klein


Rijgersberg, T.J. (Tom) wrote:
> 
> Real troubles start with the code in paragraph 7.4 which adds a
> customized list input widget. The browser/widget.pt and
> browser/sequence.js files run fine when directly invoked from the
> browser. But when I run it from the Zope instance with the added
> browser/widget.py and changed browser/configure.zcml it doesn't work.
> 

Although I'm not sure why, but the following changes help:

--- browser/widget.py.orig  2004-07-10 17:59:36.0 +0200
+++ browser/widget.py  2006-03-19 18:28:16.0 +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."""
--
View this message in context: 
http://www.nabble.com/Problem-running-examples-from-Zope3-book-Weiterhausen-t1257485.html#a3482644
Sent from the Zope3 - users forum at Nabble.com.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problem running examples from Zope3 book Weiterhausen

2006-03-16 Thread Robert Boyd
On 3/10/06, Rijgersberg, T.J. (Tom) <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm a newbie to Zope and taking my first steps into this wonderful world by
> going through the book 'Web Component Development with Zope 3' from Philipp
> von Weitershausen.
>
> Up to page 94 I have had little difficulties reproducing the examples. I'm
> using the downloaded example code as described in the book. I'm running Zope
> 3.2 on a Windows 2000 machine with Python 2.4 installed. My browser is
> Mozilla Firefox 1.5.0.1.
>
> Real troubles start with the code in paragraph 7.4 which adds a customized
> list input widget. The browser/widget.pt and browser/sequence.js files run
> fine when directly invoked from the browser. But when I run it from the Zope
> instance with the added browser/widget.py and changed browser/configure.zcml
> it doesn't work.
[traceback snipped]

I haven't gotten to that point in the book, but just now, I installed
chapter 7 as worldcookery, got the error, then went to
browser/configure.zcml, commented out the widget elements in addForm
and editForm, and now I can add a recipe, edit its attributes, and
preview it. I suggest investigating what's changed with widgets in
Zope 3 since the book was published.

Rob
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problem running examples from Zope3 book Weiterhausen

2006-03-15 Thread ksmith99

Hi Tom,

Personally, I'd switch to an earlier version of Zope3 to match the version
in the book.  You also might try  
including widget.py and configure.zcml here to aid in debugging.

Kevin
--
View this message in context: 
http://www.nabble.com/Problem-running-examples-from-Zope3-book-Weiterhausen-t1257485.html#a3428080
Sent from the Zope3 - users forum at Nabble.com.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Problem running examples from Zope3 book Weiterhausen

2006-03-09 Thread Rijgersberg, T.J. (Tom)



Hi,
 
I'm a newbie to Zope 
and taking my first steps into this wonderful world by going through the book 
'Web Component Development with Zope 3' from Philipp von 
Weitershausen.
 
Up to page 94 I have 
had little difficulties reproducing the examples. I'm using the downloaded 
example code as described in the book. I'm running Zope 3.2 on a Windows 2000 
machine with Python 2.4 installed. My browser is Mozilla Firefox 
1.5.0.1.
 
Real troubles start 
with the code in paragraph 7.4 which adds a customized list input widget. The 
browser/widget.pt and browser/sequence.js files run fine when directly invoked 
from the browser. But when I run it from the Zope instance with the added 
browser/widget.py and changed browser/configure.zcml it doesn't 
work.
 
Here is what 
happens: 
I copied the 
downloaded code from the book to 
C:\Python24\Zope3InstanceWeitershausen\lib\python (this was successful for the 
previous examples)
I start Zope by: 
C:\Python24\Zope3InstanceWeitershausen\.\bin\runzope
I've made sure that 
C:\Python24\Zope3InstanceWeitershausen\lib\python is in my 
PYTHONPATH
I've deleted 
C:\Python24\Zope3InstanceWeitershausen\var\Data.fs manually to get rid off 
previous experiments
I start my browser 
and log on using http://localhost:8080/manage
It al looks fine and 
I have the Add - Recipe button
I click on Add 
Recipe and the screen goes blank displaying:
Going back and 
looking up the error log I see:
 
Traceback (innermost 
last):  Module zope.publisher.publish, line 138, in 
publish    result = publication.callObject(request, 
object)  Module zope.app.publication.zopepublication, line 161, in 
callObject    return mapply(ob, 
request.getPositionalArguments(), request)  Module 
zope.publisher.publish, line 113, in mapply    return 
debug_call(object, args)   - __traceback_info__: >  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 475, 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 120, in 
__call__    return self._create(args)  Module 
zope.app.form, line 102, in _create    instance = 
self._widget_factory(*args)TypeError: __init__() takes exactly 3 arguments 
(4 given)
 
As a newbie this is 
all too much for me. I've visited the books' website but there are no clues from 
the errata. I've tried to look into release notes to see if something changed in 
Zope 3.2 that explains it but no luck.
 
Can anyone help me 
out? I've tried running other examples form the book past chapter 7 but they 
also fail probably to my same mistakes.
 
Regards,
 
Tom

This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/disclaimer/email.html

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users