I've two classes: Question and Answer. A question may have 0 or many answers.
class Question(Base):
__tablename__ = "questions"
answers = relationship('Answer', backref='question',
primaryjoin="Question.id==Answer.question_id")
class Answer(Base):
__tablename__ = "answers"
Now I want to find all the questions have no answers, how to do it?
I tried:
Session.query(Question).filter('count(Question.answers)==0').all()
It is incorrect. What is the right one?