New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to construct query #122
Comments
did you get a solution to this? I have the same problem |
I'm getting the same error for even some of the basic examples from the docs (ex. https://flask-restless.readthedocs.org/en/latest/quickstart.html), using python 2.7 and the following packages in a virtualenv (all dependencies from "pip install flask-restless"):
The issue goes away if you remove the "backref" option from the sqlalchemy relationship() call. |
I was able to fix my issues by downgrading to sqlalchemy 0.7.9. |
Thanks @sk3w --- it seems something has changed in SQLAlchemy between version 0.7.9 and 0.8.0b2 that is causing some issue. I'll look into it. |
This should be fixed now, by 995754a (and the related 90f24b5). Now, if you are getting errors, it should be because you described your models incorrectly. Here's the issue. According to the warning in this section of the SQLAlchemy documentation, dynamic relationship can only be used for one-to-many relationships, not many-to-one relationships. I was using SQLAlchemy incorrectly in my examples and test cases. In version 0.7.9, SQLAlchemy provided no warning or exception. In version 0.8.0b2, SQLAlchemy raises an exception if you try to use a dynamic relationship loader for the wrong kind of relationship. |
{
"message": "Unable to construct query"
}
That is the message I receive when accessing the API.
Here is what I have in my app.py
also tried this which is a one to many join, even though I dont really need one. (This one worked before with roughly the same data but now it does not also work - giving same message).
I am not sure what has changed in my data or env to make it output such an error so please I would appreciate some help with fixing this.
Is there any debug options so I can see whats happening?
The text was updated successfully, but these errors were encountered: