Re: [SQLObject] Can SQLBuilder do this?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Markus G. <m.g...@gm...> - 2007-08-20 19:02:50
|
2007/8/20, Oleg Broytmann <ph...@ph...>: > 1 contradicts 2 because SQLBuilder doesn't perform any conversion. > Column objects perform conversions. So, either SQLObject with conversions > or SQLBuilder with raw data, I see. > > for row in connection.queryAll( 'SELECT DISTINCT date(entry.begin) > > SELECT DISTINCT in SQLBuilder is implemented in the trunk by Luke > Opperman. Wait until it will be released as SQLObject 0.10, or use the code > from the trunk, it is stable enough to be useable. > > from sqlobject.sqlbuilder import Select, func > for row in conn.queryAll(conn.sqlrepr( > Select(func.date(Entry.q.begin), distinct=True) > )) Ok. And is there a way to put the 'query' variable, which is of __class__ sqlobject.sqlbuilder.SQLOp, from my original code into the SQLBuilder version? The query is already constructed elsewhere and passed around in my program. Kind regards, Markus |