我最近使用Flask-Restless来创建API。
当我尝试查询API时,在web浏览器(firefox)上收到"unable to construct query“错误消息。下面是查询:
http://localhost:5000/api/product?q={ "filters" : [ { "name": "name", "op": "eq", "value": "mercy" } ] }下面是Product类:
class Product(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(80))
details = db.Column(MutableDict.as_mutable(HSTORE))
def __init__(self, name, details):
self.name = name
self.details = details
def __repr__(self):
return self.name此错误仅在我使用query时发生。只访问http://localhost:5000/api/product运行得很好。
有什么问题吗?
我试图省略HSTORE字段,但仍然错误。所以我假设HSTORE不是嫌犯。
发布于 2013-02-07 15:55:38
尝试val而不是value
https://stackoverflow.com/questions/14745883
复制相似问题