Answer the question
In order to leave comments, you need to log in
How to set column_property?
It doesn't work like that
user_count = column_property(
db.session.query(func.count(User.id))
)
# RuntimeError: application not registered on db instance and no application bound to current context
user_count = column_property(
User.query.with_entities(func.count(User.id))
)
user_count = column_property(
select([func.count(User.id)])
)
user_count = column_property(
select([func.count(User.id)])
.join(User.attrs)
)
# sqlalchemy.exc.ArgumentError: FROM expression expected
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question