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')
非常感謝你!