Re: [SQLObject] Can SQLObject do this?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2008-08-20 18:57:12
|
On Wed, Aug 20, 2008 at 11:42:56AM -0700, Golemon, Buck wrote: > Neglecting the 'group by', how would you do this? If you want, I can Two-tables join is done automatically - just declare relationship using ForeigmKey/MultipleJoin/RelatedJoin. Three (or more) tables joins, unfortunately, require more work. IWBN to solve this. > look into submitting a patch to add 'group by' capability. It is not that easy. Look, when you declare a table you also declare the names and types of the columns: class MyTable(SQLObject): col1 = Type1Col() col2 = Type2Col() and when you call MyTable.select() SQLObject knows the list of columns. With GROUP BY you have to pass a different list of columns; what would be an API? sqlbuilder.Select() can do groupBy because it knows the list of columns and ignores their types altogether. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |