Re: [SQLObject] Strange behavior in sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Octav C. <och...@gm...> - 2010-09-24 20:18:00
|
It seems I answered my own questions. You can do this by using get_attr: p = Person(first_name='', last_name='') get_attr(p, 'first_name') # will return the first name Thanks, -- Octav On Fri, Sep 24, 2010 at 1:11 PM, Octav Chipara <och...@gm...> 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')? > > Thanks, > --Octav > > > On Fri, Sep 24, 2010 at 3:06 AM, Oleg Broytman <ph...@ph...> wrote: > >> On Thu, Sep 23, 2010 at 06:51:14PM -0700, Octav Chipara wrote: >> > File >> > >> "/Library/Python/2.6/site-packages/SQLObject-0.13.0-py2.6.egg/sqlobject/main.py", >> > line 892, in get >> > val = cls(_SO_fetch_no_create=1) >> > TypeError: __init__() got an unexpected keyword argument >> > '_SO_fetch_no_create >> >> It seems cls here is not an SQLObject class because SQLObject.__init__ >> accepts any keywords arguments. You need to investigate what type is cls. >> >> Oleg. >> -- >> Oleg Broytman http://phd.pp.ru/ ph...@ph... >> Programmers don't die, they just GOSUB without RETURN. >> >> >> ------------------------------------------------------------------------------ >> Nokia and AT&T present the 2010 Calling All Innovators-North America >> contest >> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada >> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in >> marketing >> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store >> http://p.sf.net/sfu/nokia-dev2dev >> _______________________________________________ >> sqlobject-discuss mailing list >> sql...@li... >> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss >> > > |