Re: [SQLObject] Query OneToMany from Many Class
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ma...> - 2005-08-17 11:05:02
|
On Tue, Aug 16, 2005 at 06:38:36PM -0500, Randall Smith wrote: > From the Person/Address example in the documentation, is it possible to > do something like this? > > robert_addresses = Address.select(Person.q.firstName == 'Robert') What do you want to be in the addreses? A list of values? robert_addresses = [address.address for address in Address.select(Person.q.firstName == 'Robert')] > For troubleshooting, how can I output the SQL command generated by a select? print Address.select(Person.q.firstName == 'Robert') Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |