【问题标题】:python flask and sqlalchemy errorpython烧瓶和sqlalchemy错误
【发布时间】:2018-02-22 23:31:41
【问题描述】:

我在烧瓶中开发了这个 api:

https://gist.github.com/scaltro/ca5a4a6256ff34a4e4163afacc95c6e0

当我在 api 上执行此操作时:

/api/search?query=dsadsads&offset=0&limit=15&sort=recommended&search_id=1519341673454

返回此错误:

https://gist.github.com/scaltro/374b4303e275e17475eb0b488aa4bb64

moddels 数据库是这样的:

https://gist.github.com/scaltro/37ab7d6180e88d1ae23b55142d186c39

我输了一夜,不知道问题出在哪里,只有在get中使用查询搜索时才返回此错误。

【问题讨论】:

    标签: python flask flask-sqlalchemy


    【解决方案1】:

    您数据库中的search_query 列是一个整数,而不是您期望的string。您要么需要手动更改它,要么只需重新创建数据库

    【讨论】:

      猜你喜欢
      • 2020-05-31
      • 2018-04-02
      • 1970-01-01
      • 2012-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-31
      • 1970-01-01
      相关资源
      最近更新 更多