To do multiple-table joins needs to do a graph search. More specifically
a Steiner graph search. I have an implementation that I was planning to
put on top of SQLObject to achieve this. If you want to think about
adding this as a feature to SQLO, I'd be very happy to talk about it.
For the groupby api, I was thinking something like:
MyTable.select().groupby("col1", "col2")
or maybe
MyTable.select().groupby(MyTable.col1, MyTable.col2)
or even
MyTable.select(..., groupby=("col1", "col2"))
Whichever fits the existing style best.
Assuming select() returns some query object, that object would need to
grow a groupby(*argv) method (in the first two options).
I'm not sure how the column types are relevant here.
--Buck
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Oleg Broytmann
Sent: Wednesday, August 20, 2008 11:57 AM
To: [email protected]
Subject: Re: [SQLObject] Can SQLObject do this?
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/
[EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
------------------------------------------------------------------------
-
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss