[Zope3-Users] Nested lists- "iteration over non-sequence"

Tom Dossis td at yoma.com.au
Sat Nov 11 16:53:16 EST 2006


Daniel M wrote:
> Hi Kevin,
> Thanks for the help! 
> 
> I've studied your example at
> http://zope3demos.googlecode.com/svn/tags/zope3demos-200610-21/otherdemos/objectsofobjects2/ 
> but I don't see how I could extend this example into a "List of List".
> 
> Suppose I want to change your IPerson to include a list, such as:
> 
> class IPerson(interface.Interface):
>     first = schema.TextLine(title=u"firstname")
>     last = schema.TextLine(title=u"lastname")
>     names = schema.List(title=u'Names',
>                           value_type=schema.TextLine(title=u"names"),
>                           required=False)
> 
> I can't figure out how to create to modify the widgets so that
> AddressBook will display correctly... I keep getting the "Iteration over
> non sequence" exception.


Hi Daniel,
Taking the error at face-value, the following may (or not) help:

>     names = schema.List(title=u'Names',
>                           value_type=schema.TextLine(title=u"names"),
>                           required=False,
>                           default=[])



More information about the Zope3-users mailing list