you need a column-based expression there so you should use
literal_column:
http://docs.sqlalchemy.org/en/latest/core/sqlelement.html?highlight=literal_column#sqlalchemy.sql.expression.literal_column
but also that expression won't be usable in every case because you are
correlating it to the name
I'm trying to write a column_property that queries a table that will be
defined after the current table is defined. I tried using raw SQL but I'm
getting an error.
On the "page" table I define a "count_posts" column_property.
count_posts = orm.column_property(text(
'SELECT count(post.id)