Re: [SQLObject] Select does not work with some fieldname
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Petr J. <pet...@tp...> - 2009-11-08 21:01:24
|
> please help. > how do i this SQL > SELECT * > FROM `TAthlet` > WHERE TCountry_id = 'AUT' > > The table "TAthlet" have this fields: > TUnion_id > id > short > name > TGender_id > TGoup_id > TCountry_id > > This does not work: > from sqlobject import * > sqlhub.processConnection = > connectionForURI('mysql://archer:xxxxxx@localhost/adb') > > class TAthlet(SQLObject): > class sqlmeta: > #if i dont do this i get a wrong tathlet table > table = "TAthlet" > fromDatabase = True > > TAthlet._connection.debug = True > r = TAthlet.select(TAthlet.q.Tcountry_id=='AUT') > > The Error: > AttributeError: TAthlet instance has no attribute 'Tcountry_id' > what about: r = TAthlet.select(TAthlet.q.TcountryId=='AUT') Petr |