【发布时间】:2017-09-28 00:56:28
【问题描述】:
我正在尝试向 Web 应用程序添加一项功能,其中在通过 JavaScript 和 SQLAlchemy 拖动地图时坐标将自动更新。但是我的数据库查询更新路由时出现错误。这是我的查询。
if sw_lng <= ne_lng:
# doesn't cross the antimeridian
rows = City.query.filter(sw_lat <= City.latitude and City.latitude <= ne_lat and (sw_lng <= City.longitude and City.longitude <= ne_lng)
).group_by(City.country_code, City.city_name, City.region
).order_by(func.random()).limit(10)
这里是相关的错误信息:
raise TypeError("Boolean value of this clause is not defined")
TypeError: Boolean value of this clause is not defined
任何帮助将不胜感激。
【问题讨论】:
标签: python sqlalchemy