[Zope-DB] Newbie question: zsql result conundrum
Kevin Chambers
kevin@molingo.com
Mon, 19 May 2003 15:57:05 -0700
Thanks for helping me understand the endlessly fascinationg "zopization" of python!
KC
Dieter Maurer wrote:
> Kevin Chambers wrote at 2003-5-15 20:44 -0700:
> > I know there must be an easy way to get this. I need to get a field data from
> > ...
> > field1="firstname"
> > ...
> > print "%s: %s" % (field1, rec.firstname)
>
> You ask here for "computed attribute access".
>
> Python's way to support it is the "getattr" function:
>
> getattr(object,expr_evaluating_to_attribute_name [,default])
>
> More information in the Python Library Reference manual.
>
>
> Dieter