Flask-Restless cannot build request

I recently used Flask-Restless to build an API.

When I tried to request the API, I got the error "unable to build request" in the browser (firefox). Here is the request:

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 occurs when using a query. access only http://localhost:5000/api/product

worked fine.

What is the problem?

I tried to exclude the HSTORE field but still error. So my guess is that HSTORE is not a suspect.

+3


source to share


1 answer


Try val

insteadvalue



link

+1


source







All Articles