On 11/19/2015 09:48 AM, Naveen Michaud-Agrawal wrote:
> I'm building a small GUI on top of sqlalchemy and would like to change
> the alignment of the columns based on the type (string or numeric). This
> works fine when the query is generated through query objects (using Mike
> Bayer's answer
> from
> http://stackoverflow.com/questions/2258072/sqlalchemy-getting-column-data-types-of-query-results,
> using either q.columns or res.context.compiled.statement.columns), but
> those aren't populated on a TextFrom object (or it's response). Is there
> any way short of checking the resulting data?
anything that selects columns has a .c. collection, including TextAsFrom:
>>> from sqlalchemy import text, column, String, Integer
>>> t = text("select a, b from table").columns(column('a', String),
column('b', Integer))
>>> t.c.a.type
String()
>>> t.c.b.type
Integer()
>
> Thanks,
> Naveen
>
> --
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
--
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.
For more options, visit https://groups.google.com/d/optout.