[Zope] Propblem with script from Zope book

Geir Bækholt Geir Bækholt
Fri, 11 Apr 2003 17:45:16 +0200


On  Fri, 11 Apr 2003 11:20:53 -0400 GMT (..17:20 where i live(GMT+1) )
Jamie asked the Zope mailinglist about the following:
  
J> I'm having problems running this example script from the Zope Book,
J> Advanced Scripting Chapter, p. 183

J> """
J> Returns all sub-objects that have a given status
J> property.
J> """
J> results=[]
J> for object in context.objectValues():
J>     if object.getProperty('status') == status:
J>         results.append(object)
J> return results

J> It seems to be starting an endless loop or something, the browser can
J> sit for a half an hour and still not change.

Might just be that your loops finds no objects for which status ==
status.. When a script returns false (0, None, empty list etc.. ) the
browser does not get any visible response...

try changing this one line:
results=[]
to
results=["dummy"]
and see if it still hangs....

:)


--
Geir Bækholt