python - flask post提交timestamp不能作为参数,这是为什么?
巴扎黑
巴扎黑 2017-04-18 10:31:35
0
2
493
import datetime
u = models.User.query.get(1)
p = models.Post(body='my first post!', timestamp=datetime.datetime.utcnow(), author=u)

巴扎黑
巴扎黑

reply all(2)
迷茫

Because the Post class you defined does not have the timestamp attribute: https://github.com/zzzeek/sql...

大家讲道理

Send the Model but I can’t see if it’s the wrong type

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!