[Zope] looping through objectValues, how to get methods?
ed colmar
element@immersivearts.com
Wed, 19 Jul 2000 09:09:01 -0600
I have a method that looks through "objectValues". Using "hasattr" and
"getattr" I can see the variables contained in the object.
How do I get the values generated from an object's method in a similar
fashion?
For example:
def dj_experince_statistics(self):
"""
"""
rlist = self.People.objectValues('SRPersonPost')
newbcount=0
for i in rlist:
if hasattr(i, 'validated'): #get validated variable
if hasattr(i, 'djname'): #get djname variable
if hasattr(i, 'mixing_for()'): #try to get
mixing_for() method
days_mixing=getattr(i,'mixing_for()')
if days_mixing < 730.0:
newbcount=newbcount+1
return newbcount
BTW this does not work.
Thanks for any suggestions!
-ed-