type_coerce() does this on a per-statement basis: http://docs.sqlalchemy.org/en/rel_0_8/core/expression_api.html?highlight=cast#sqlalchemy.sql.expression.type_coerce
it's fairly recent and has had some fixes that are 0.8 only. On Dec 17, 2012, at 4:48 PM, Burak Arslan wrote: > Hi, > > I have a column of type PGObjectXml. > (https://github.com/arskom/spyne/blob/ed574564383ff8cc757cd4609eede6d049c9b574/spyne/util/sqlalchemy.py#L184) > > What is the best way of replacing the designated column type temporarily just > for a select query? E.g. How do I fetch the column as a simple string? Or how > do I temprarily replace it with another custom type that parses the xml > string as an ElementTree object? > > Best Regards, > Burak > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
