python - Flask web开发的关注文章部分,属性方法followed_posts调用无效,shell里指令直接写入user.id有效?
PHP中文网
PHP中文网 2017-04-18 10:14:53
0
2
316
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
大家讲道理

It was solved later
I was hit on the console

Post.query.join(Follow, Follow.followed_id == Post.author_id)\
             .filter(Follow.follower_id == cat.id)

Copy and paste it, change cat to self, and change it to the same code I typed before
Then it’s OK...


But I definitely played like this before

Post.query.join(Follow, Follow.followed_id == Post.author_id)\
             .filter(Follow.follower_id == self.id)

Checked many times

PHPzhong

There is no problem with the query statement. Are the prerequisites not done well? For example, the user has not followed anyone? ? ?
Look at mine:

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template