[Zope] objectValues(meta_type) in python script

Gitte Wange gitte@mmmanager.org
24 Oct 2001 12:39:33 +0200


Hello,

I am in the process of optimizing some of my scripts and moving some
code from dtml methods into python Scripts.

I am trying to find an object in a folder.
I know there is only one object with this metatype ('MMM Shop Shopping
Cart') in the folder.

But this doesn't work:

for item in memberfolder.objectValues('MMM Shop Shopping Cart'):
   shopping_cart = context.getId()

return shopping_cart

Now I expected to recieve a string containing 'Shopping Cart', but I
recieved a string containing 'CD001' which is a product, not a shopping
cart.

Doesn't objectValues() work in python scripts ?

TIA,
-- 
Gitte Wange Jensen

Sys Admin, Developer and a lot more
MMmanager.org Aps, Denmark

Phone: +45 29 72 79 72
Email: gitte@mmmanager.org
Web: www.mmmanager.org

Quote of the day:
[unrestricted Python scripts] cannot be created or edited unless a
special
environment variable is set. In order to create or edit XXX Python
Scripts,
you have to set "ALL_YOUR_BASE_ARE_BELONG_TO" equal to "US".

    - Evan, http://www.zope.org/Members/4am/XXXPythonScripts