[Product-Developers] Re: Using List or Tuple from zope.schema
Derek Richardson
derek.richardson at gatech.edu
Mon Dec 31 20:04:51 UTC 2007
It needs a 'value_type' parameter to designate what type the list holds.
Look at p59 of philiKON's book (2nd ed.).
The error looks like it's trying to do multiadaption with a None for the
second argument. This is consistent with my advice above.
Derek
Tim Hicks wrote:
> Hi,
>
> Is it possible to use zope.schema.Tuple (or .List) with plone 3? I'm
> trying to write a portlet that effectively has a 'LinesField' (in AT
> terms) as one of its attributes. To that end, I have::
>
> class IFeedLinksPortlet(IPortletDataProvider):
> """A portlet listing links to syndication feeds.
> """
>
> tal_lines = schema.List(
> title=_(u'Objects to display feeds for.'),
> description=_(u"TAL statements referring to objects to display
> feeds for."),
> required=True,
> default=['context',])
>
>
> However, when I try to add my portlet, I get the traceback pasted below.
> Any idea how to get through this?
>
> Thanks,
>
>
> Tim
>
>
> 2007-12-31 18:46:17 ERROR Zope.SiteErrorLog
> http://localhost:8080/test/plone/++c
> ontextportlets++plone.leftcolumn/+/plone.app.syndication.outbound.portlets.FeedLinks
> Traceback (innermost last):
> Module ZPublisher.Publish, line 119, in publish
> Module ZPublisher.mapply, line 88, in mapply
> Module ZPublisher.Publish, line 42, in call_object
> Module plone.app.portlets.browser.formhelper, line 53, in __call__
> Module zope.formlib.form, line 769, in __call__
> Module Products.Five.formlib.formbase, line 55, in update
> Module zope.formlib.form, line 732, in update
> Module zope.formlib.form, line 856, in setUpWidgets
> Module zope.formlib.form, line 302, in setUpInputWidgets
> Module zope.formlib.form, line 323, in _createWidget
> Module zope.component._api, line 101, in getMultiAdapter
> Module zope.component._api, line 114, in queryMultiAdapter
> Module zope.component.registry, line 206, in queryMultiAdapter
> Module zope.interface.adapter, line 482, in queryMultiAdapter
> Module zope.app.component.metaconfigure, line 160, in __call__
> Module zope.app.form.browser.itemswidgets, line 56, in
> CollectionInputWidget
> Module zope.component._api, line 103, in getMultiAdapter
> ComponentLookupError: ((<zope.schema._field.List object at 0x06017510>,
> None, <HTTPRequest,
> URL=http://localhost:8080/test/plone/++contextportlets++plone.leftcolumn/+/plone.app.syndication.outbound.portlets.FeedLinks>),
> <InterfaceClass zope.app.form.interfaces.IInputWidget>, u'')
More information about the Product-Developers
mailing list