-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
Feature request: filter like and ilike #421
Comments
I would like to work on it this weekend, @abondar can you assign it to me please? |
@WisdomPill You don't need it assigned to you if you want to work on it. Just state you want to? I thought about this and SQL Injection abilities, differentiating between I think we can do it safely, but will definitely have to apply lots of scrutiny/testing to this. |
Okay, I thought that because there are projects on this repository that assignation is the way to go, good to know.
For sure first thing to do is to add some tests with |
We are not too strict on anything here. Except possibly the code. But even there I have worked with projects where there is some kind of tribal agreement as to how code should be written. As long as the CI passes and there isn't an obviously better way of doing things, it's all good. Just look at the abomination that is our test helpers :-( They are really showing their age, and possibly a reason to bump major version as it affects a lot of people. |
Has this been implemented, I have searched the documentation, but I can't find anything there. May be my searching abilities. |
Ok, a little more searching let me to the correct location. This seems to have been implemented as |
Example of usage:
users = await User.filter(first_name__ilike="c%r")
I know this can be done with startswith and endswith, but there are cases where using the LIKE operator is better:
users = await User.filter(first_name__ilike="j_r%")
This would be used to match Jeremy, Jorge, Jordan...
The text was updated successfully, but these errors were encountered: