Вопрос

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.

Это было полезно?

Решение

Try val instead of value

reference

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top