[Grok-dev] Problems rendering zope.schema.List
Sebastian Ware
sebastian at urbantalk.se
Thu Jul 5 08:56:26 EDT 2007
I am trying some of the more interesting field types in zope.schema.
I have added a List field to my interface IProtonObject...
authors = schema.List(title=u'List of Authors', unique=True,
value_type=schema.TextLine(title=u'Name'))
...but I get en error when I try to add the object...
TypeError: iteration over non-sequence
...I use a simple add class:
class Add(grok.AddForm):
grok.context(ProtonCMS)
form_fields = grok.Fields(id=schema.TextLine(title=u'id'))
form_fields += grok.AutoFields(ProtonObject)
Traceback:
return expression(self)
- /Users/jhsware/GrokProjects/ProtonCMS/eggs/grok-0.9dev_r77371-
py2.4.egg/grok/templates/default_edit_form.pt
- Line 47, Column 12
- Expression: <PathExpr standard:u'widget'>
File "/local/zope3.3/lib/python/zope/tales/expressions.py", line
217, in __call__
return self._eval(econtext)
File "/local/zope3.3/lib/python/zope/tales/expressions.py", line
211, in _eval
return ob()
File "/local/zope3.3/lib/python/zope/app/form/browser/
sequencewidget.py", line 57, in __call__
self._update()
File "/local/zope3.3/lib/python/zope/app/form/browser/
sequencewidget.py", line 62, in _update
sequence = self._getRenderedValue()
File "/local/zope3.3/lib/python/zope/app/form/browser/
sequencewidget.py", line 128, in _getRenderedValue
sequence = list(self._data)
TypeError: iteration over non-sequence
Mvh Sebastian
More information about the Grok-dev
mailing list