[Zope] objectValues(meta_type) in python script

Philippe Jadin philippe@123piano.com
Wed, 24 Oct 2001 13:13:22 +0200


> > for item in memberfolder.objectValues('MMM Shop Shopping Cart'):
> >     shopping_cart = item.getId()
> >
> > return shopping_cart
> 
> Well I just discovered that .... damn me :-)
> 
> but then the object itself is just item ?
> And the object's id must by item.getId() ...
> 
> I'm learning :-)))
> (You need to think different when doing things in a PythonScript, that
> you usually do i dtml) ...

well, context is exactly that : context. (zope context)

In python, when you loop over elements using for .. in, the current
element is the var you give it as first "argument"

for item in xxxx:
  item will be here = to the current item being looped over


hth

Philippe