From: Oleg B. <ph...@ph...> - 2011-07-01 09:54:03
|
hi! On Thu, Jun 30, 2011 at 06:32:27PM -0500, Chris Bennett wrote: > Say i have a function on my MySQL database that returns a new table. > so i access sqlbuilder.func.myfunc() by: > query = myconn.sqlrepr(sqlbuilder.Select(sqlbuilder.func.myfunc())) > results = myconn.queryAll(query) > and results is a tuple of tuples > Is > there a way to have that table be returned as a SelectResults class so > i can access its attrs and everything? There is no currently. In TODO http://sqlobject.org/TODO.html there is an item Expression columns - in SELECT but not in INSERT/UPDATE. Something like this: class MyClass(SQLObject): function1 = ExpressionCol(func.my_function(MyClass.q.col1)) function2 = ExpressionCol('sum(col2)') But we don't have any code yet. Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |