search

Home  >  Q&A  >  body text

python - flask post提交timestamp不能作为参数,这是为什么?

import datetime
u = models.User.query.get(1)
p = models.Post(body='my first post!', timestamp=datetime.datetime.utcnow(), author=u)

巴扎黑巴扎黑2787 days ago517

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-18 10:33:35

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 10:33:35

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

    reply
    0
  • Cancelreply