On Fri, Sep 24, 2010 at 01:17:33PM -0700, Octav Chipara wrote:
> get_attr(p, 'first_name') # will return the first name
In Python (not in SQLObject) this is equivalent to p.first_name. You
only need to call getattr if the name of the attribute is in a variable:
attr_name = 'first_name'
print g
On Fri, Sep 24, 2010 at 01:11:13PM -0700, Octav Chipara wrote:
> Thanks Oleg. BTW, is there an easy way to get attributes of an sqlobject by
> their name? For example, if I have a person with attributes first_name and
> last_name, however do i go around retrieving them. Could I do something like
>