[Zope] loop over non sequence !!!
seb bacon
seb@jamkit.com
Thu, 29 Nov 2001 16:34:06 +0000
* Casey Duncan <c.duncan@nlada.org> [011129 14:12]:
> On Thursday 29 November 2001 08:45 am, sanjeev c s allegedly wrote:
> > hello,
> > <dtml-in expr="pics.objectValues()">
> > <dtml-if sequence-end>
> > <dtml-call "pics.manage_delObjects(id)">
> > </dtml-if>
> > </dtml-in>
> > ----------------------------------------------
> > i get a error saying
> > Error Type: TypeError
> > Error Value: loop over non-sequence
> last_id = context.pics.objectIds()[-1]
> context.pics.manage_delObjects(last_id)
Off the top of my head, the TypeError is probably because you're
passing a string rather than a list to delObjects (note the plural) -
so it should be
last_id = context.pics.objectIds()[-1]
context.pics.manage_delObjects((last_id,))
seb