Re: [SQLObject] Query question

2007-04-20 Thread Oleg Broytmann
On Thu, Apr 19, 2007 at 04:41:22PM -0500, Jim Steil wrote: > But, I don't have a UserPlant object. The table was created because of > the joins in the User and Plant objects. It was in the mailing list just yesterday, see the list archives. You have to recreate and declare the table. Oleg. -

Re: [SQLObject] Query question

2007-04-19 Thread Oleg Broytmann
On Thu, Apr 19, 2007 at 04:03:37PM -0500, Jim Steil wrote: > SELECT * FROM qucm WHERE plantId IN (SELECT plantId FROM userPlant WHERE > userId = 2) Untested: Qucm.select(IN(Qucm.q.plantId, Select(UserPlant.q.plantId, where=(UserPlant.q.userId == 2))) Oleg. -- Oleg Broytmann

[SQLObject] Query question

2007-04-19 Thread Jim Steil
Hi: I'm having trouble formulating the right query for my circumstance. Here is the SQL statement I'm trying to build: SELECT * FROM qucm WHERE plantId IN (SELECT plantId FROM userPlant WHERE userId = 2) Here is my model: class Plant(SQLObject): class sqlmeta: style = Style(l