-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support for "contains" filter string function #43
Comments
Hi @attieretief This is a great point. I also implemented this for my own use as well as a related "lacks" or "does not contain" method. I'm including it below in case you find it helpful. def contains(self, value):
"""Extend the StringProperty with contains method"""
value = self.escape_value(value)
return u'contains({0}, {1})'.format(self.name, value)
def lacks(self, value):
"""Does not contain"""
value = self.escape_value(value)
return u'not(contains({0}, {1}))'.format(self.name, value) |
eblis
referenced
this issue
in eblis/python-odata
Mar 2, 2023
eblis
referenced
this issue
in eblis/python-odata
Mar 6, 2023
eblis
referenced
this issue
in eblis/python-odata
Mar 6, 2023
This project looks to be no longer maintained, i have forked it here and tried to add (some) of your suggested functionality. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The ODATAV4 standard supports the string function "contains"
http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc444868693
See 11.2.5.1.2 Built-in Query Functions in the following section
http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html#_Toc453752288
If implemented exactly the same way as this project already implements "startswith" and "endswith", then wildcard search on specified attributes can be used.
This was achieved by modifiying property.py
The text was updated successfully, but these errors were encountered: