Mike and others :)

I have the following sql:
select 
    models.code,
    *array*(
        select *(clients.id, clients.code) *from clients
        group by clients.id, clients.code
    ) as envs
from models

I ended with something like this:
items = DBSession.query(Client.id, Client.code). \
        group_by(Client.id, Client.code). \
        subquery()

return DBSession.query(
        Model.code,
        array(items)). \
    order_by(Model.code)

but the exception is thrown:
TypeError: __init__() argument after * must be a sequence, not Alias

The question is how to use an array to be returned in query (select 
(clients.id, clients.code)) and how to pass subquery to the array?
Could you provide some ideas?

I've tested it on SA 1.0.8.

Thanks
Artur

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to