On Fri, Jun 16, 2006 at 10:23:26AM +0200, Ivan Horvath wrote:
> sql = conn.sqlrepr(sqlbuilder.Select(fieldsSum, whereSum, orderBy=ts_times.q.uid, groupBy="ts_times.uid, yearweek(ts_times.startTime)"))
> if i use list, or tuple for groupBy i receive an sql error
That's because Select's __sqlrepr__ happily calls sqlrepr(groupBy) and
sqlrepr doesn't know how to represent a sequence. The best solution would
be to add a SQLSequence class to sqlbuilder.py with appropriate __sqlrepr__
> i assume the same syntax should be applied for orderBy. am i right?
Have you tried Select() with a list in orderBy? It's rendered exactly
the same way as groupBy, so I think it will fail. It is SQLObject's
.select() (actually, SelectResults class) that does right thing with lists
Does anybody want to fix that by copying the algorithms from
SelectResults to Select? Please add some tests.
Oleg Broytmann http://phd.pp.ru/ phd@...
Programmers don't die, they just GOSUB without RETURN.