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

Make filter method take a string, eg for use with tags.contains:foo #117

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

smemsh
Copy link

@smemsh smemsh commented Sep 17, 2022

The example in README says this works:

tw.tasks.pending().filter(tags__contains='testing')

but actually in deserialize_tags(), which ends up getting this, there is expectation for a list parameter, so not sure how the example from README ever worked (!)

This patch changes .filter() method to support a string argument also, which in that case is passed through unchanged. This makes the README example work again.

Fixes #116

@smemsh smemsh force-pushed the handle-string-tags-arg branch from 78a8b97 to 10c7837 Compare September 17, 2022 22:49
@smemsh
Copy link
Author

smemsh commented Nov 22, 2022

@tbabej since you did a release, should I conclude this patch will not be merged?

the example in readme says this example works, but actually it splits
the argument by ',' unconditionally, expecting a list.  so a string will
be made into a "s,t,r,i,n,g".  so we should handle getting passed either
a single string and pass it through unchanged, or a list and join them

actually if a list, we'd want to dedupe so we use a set which is the
native type of the library for tags anyways
@smemsh smemsh force-pushed the handle-string-tags-arg branch from 10c7837 to 78aa1b6 Compare July 28, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

filter() is breaking apart dot-containing '__' value part of kwarg into comma separated string?
1 participant