[Zope3-Users] Dict Widget

Vinny vinny-mail-01+zope3users at palaceofretention.ca
Tue Feb 27 19:04:30 EST 2007


On Tue, 27 Feb 2007 21:24:10 +0100
David Johnson <djohnson at jsatech.com> wrote:

> I've seen posts about this but I am confused. Is there a Dict
> widget? I tried it and I received IInputWidget errors.
> 
> myfield = Dict(title=u'My Dictionary',
>    		key_type=TextLine(),
> 		value_type=TextLine())
> 
>    File "/Users/djohnson/sandbox/Zope-3.3.0/build/lib.macosx-10.3- 
> fat-2.4/zope/component/_api.py", line 103, in getMultiAdapter
>      raise ComponentLookupError(objects, interface, name)
> ComponentLookupError: ((<zope.schema._field.Dict object at  
> 0x3a00190>, <zope.publisher.browser.BrowserRequest instance  
> URL=http://127.0.0.1:8080/My%20Contacts/+/addContact.html>),  
> <InterfaceClass zope.app.form.interfaces.IInputWidget>, u'')
> 


I got the same thing trying to use a Tuple:

  File
"/usr/local/www/Zope3/lib/python/zope/app/form/browser/itemswidgets.py",
line 56, in CollectionInputWidget IInputWidget) File
"/usr/local/www/Zope3/lib/python/zope/component/_api.py", line 103, in
getMultiAdapter raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((<zope.schema._field.Tuple object at 0xad84a4c>,
None, <zope.publisher.browser.BrowserRequest instance
URL=http://zope.palaceofretention.ca:8080/hey/++preferences++/@@index.html>),
<InterfaceClass zope.app.form.interfaces.IInputWidget>, u'')

It seems the more complex field types might need a custom
widget.  I simply broke the tuple down into its parts and
avoided the lack of a tuple input widget.

Vinny


More information about the Zope3-users mailing list