How do I iterate through methods/functions in a list in web2py -
my code goes like:
m = ['first_time', 'first_day'] t = times() def this(): code..... item in m: getattr(t, item)()
i tried option of:
try: return t.first_time() return t.first_day() except attributeerror, e: return e.message
these codes work first method first_time()
. how can make iterate through functions in m in web2py
?
Comments
Post a Comment