From: Oleg B. <ph...@ph...> - 2004-12-16 14:44:02
|
On Thu, Dec 16, 2004 at 01:16:25PM +0200, Ksenia Marasanova wrote: > Employee.select(orderBy='first_name') > > produces: > > SELECT employee.id, employee.child_name FROM employee WHERE 1 = 1 > ORDER BY person.first_name > > then Postgres reacts to that like 'NOTICE: adding missing FROM-clause > entry for table "person"' > > which results in double number of records in the resultset because the > tables are not joined properly. The problem is that you haven't gave a query clause, and SQLObject cannot decide which tables to use. I am not sure if it is a bug. Try this (with identity clause added to use Person in the query): Employee.select(Person.q.lastName==Person.q.lastName, orderBy=Person.q.firstName) Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |