[Zope] context of a for loop

Dieter Maurer dieter@handshake.de
Thu, 6 Mar 2003 20:37:24 +0100


Fearless Froggie wrote at 2003-3-5 17:12 -0800:
 > ...
 > If I loop through a list of id's with a for loop and
 > do something to each of these objects, I get a "You
 > are not allowed to access editMetadata in this
 > context". Here's the code (here I'm just changing the
 > title of each of my items in my list 'id' to 'bob'): 
 > 
 > for item in id:
 >    item_object = getattr(context, item)
 >    item_object.editMetadata(title='bob')
 > 
 > But if I do these changes directly, it works fine:
 > 
 > item_object = getattr(context, id[0])
 > item_object.editMetadata(title='bob')

This means, the not the "0" th element has a problem but
some later one....

It has nothing to do with "for loop context".


Dieter