Reputation: 1175
I recently using Flask-Restless to create API.
When I tried to query the API, I got "unable to construct query" error message on the web browser (firefox). Here is the query:
http://localhost:5000/api/product?q={ "filters" : [ { "name": "name", "op": "eq", "value": "mercy" } ] }
and here is the Product class:
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
this error only occur when I used query. accessing only http://localhost:5000/api/product
worked fine.
What is the problem?
I've tried to ommit the HSTORE field, but still error. So, I assume HSTORE is not the suspect.
Upvotes: 3
Views: 971