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 getattr(p, attr_name)

   And, BTW, in Python the function is named getattr, not get_attr.

Oleg.
-- 
     Oleg Broytman            http://phd.pp.ru/            p...@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to