Skip to content
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

Add support for any iterable with "Terms" query #1641

Open
roxanebellot opened this issue Jan 19, 2023 · 0 comments
Open

Add support for any iterable with "Terms" query #1641

roxanebellot opened this issue Jan 19, 2023 · 0 comments

Comments

@roxanebellot
Copy link

"Terms" query currently only support list parameters : using Terms(field1=(1, 2, 3), field2={"foo", "bar"}) would result in a SerializationError.

Is there a reason not to support any iterable ? It would be more pythonic and also ease integration with other framwework (thinking of Django's QuerySet)

An easy way to implement this is redefining Terms._setattr :

class Terms():
    ...
    def _setattr(self, name, value):
        super()._setattr(name, list(value))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants