-
Notifications
You must be signed in to change notification settings - Fork 301
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
Custom queries breaks #371
Comments
I had a similar problem but never thought about using |
I've got around this by using the
rather than
Does that help at all? |
@drmclean As you mentioned and as i have shown above, there are workarounds, but the problem i believe is with multiple people working on the same, you are kind using a different way of doing things. So its kind of a problem for my boss :) |
Would it be better to have the user specify a decorator that marks the method as both a |
This could be another benefit of #406 - if you specify the custom query on the endpoint rather than on the model, you don't need to override |
I am using custom queries like this with flask sqlalchemy
This works great when used with restless..
But if i try to access the filter method on the model in a view.. like
SequenceUserTag.query.filter(SequenceUserTag.user_id == 3)
i get a errorAttributeError: 'function' object has no attribute 'filter'
But
SequenceUserTag.query().filter()
works..So i wanted to know if there is way to make this works as expected something like
Model.query.filter()
, else this breaks the pattern somehow because models for which query is not overridden work likeModel.query.filter()
butModel.query().filter()
breaksI also tried the below
This fixes the problem i mentioned above but the result from the api gives me
num_results
as length prior to the filter applied.So before filter length was 3 and after its 1. So the api gives the right data but wrong number for results
The text was updated successfully, but these errors were encountered: