0
我有2个模型:帖子和评论,一个帖子有很多评论,我如何过滤comments.count()小于2的帖子?flask sqlalchemy查询过滤器关系
Post: id(primary key), body, author_id, comments
Comment: id(primary key), body, author_id, post_id
其中,
comments = db.relationship('Comment', backref='post', lazy='dynamic')
非常感谢你!