right, ColumnElement doesn't export the "froms" from it's expression by default.

There's a method you can implement to do this, but here is another approach 
that doesn't use any private APIs:

from sqlalchemy.sql.expression import FunctionElement

class PGCompositeElement(FunctionElement):
    def __init__(self, base, field, type_):
        self.name = field
        super(PGCompositeElement, self).__init__(base)
        self.type = to_instance(type_)



On Mar 24, 2013, at 6:40 PM, Tobias Bieniek <[email protected]> 
wrote:

> I've added a small standalone script at 
> https://gist.github.com/Turbo87/5233888
> 
> The output is "SELECT (SomeFunction("table".foo)).attr1 AS anon_1", without 
> any FROM clause.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to