query = select([func.to_json(User)]).select_from(User)
# Printing the query returns something that seems to make sense:
# >>> print select([func.to_json(User)]).select_from(User)
# SELECT to_json(:to_json_2) AS to_json_1
# FROM users
# But when I go to execute, I get:
session.execute(query)
# sqlalchemy.exc.ProgrammingError: (ProgrammingError) can't adapt type 'DeclarativeMeta' 'SELECT to_json(%(to_json_2)s) AS to_json_1 \nFROM users' {'to_json_2': <class 'monitoring.models.User'>}
--
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+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
That is the case, I'm afraid. Thanks for the prompt reply and thanks for making such a killer library. :-)
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/nSjb2efvyvY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy+...@googlegroups.com.