Re: func->SelectResults

Oleg Broytman <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <[email protected]>
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/            [email protected]
           Programmers don't die, they just GOSUB without RETURN.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.