[Zope] get a object using its id inside a pythong script

alan runyan runyaga@thisbox.com
Sun, 13 May 2001 03:27:19 -0500


retObjs = []

"""
this is very inefficient, but works ;(

for award in context.assignedAwards:
    for objId in context.marketingAwards.objectIds():
        if award==objId:
            retObjs.append(objId)
"""

for award in context.assignedAwards:
    if award in context.marketingAwards.objectIds():
        retObjs.append(context.marketingAwards.award)       #get a award
Attribute Error.. how do i do this?
#appears in DTML you would use teh _.getitem(objId) hack, where is getitem?

return retObjs

Question 1: how can i please do this efficiently?
Question 2: why doesnt ObjectManager have a getObject(self, objectId) method
on it?  or am i overlooking something?
Question 3:  abit off topic-- are people generally happy w/ data centric
ZClasses?  some people scare me with their experiences, but it seems that
purely data centric ZClasses (although can be brittle) -- are nonviolatile
things.  I am pushing ZOPE as a solution and am selling ZClasses very
heavy -- nonprogrammers will be maintaing the system after its done.
(service oriented objects - I would do in Python)

thanks in advance,
~runyaga