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
> Person.get_attr('first_name')?

   What is Person in your question - an SQLObject class (representing an
entire SQL table) or an instance of such class (representing one row for
the table)? If it's a class - you need to call Person.select() and loop
over the result rows. If it's an instance - just get (or set)
Person.first_name:

    print Person.first_name
    Person.first_name = 'Octav'

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