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

"does not contain" table filter #2287

Closed
simonw opened this issue Feb 28, 2024 · 2 comments
Closed

"does not contain" table filter #2287

simonw opened this issue Feb 28, 2024 · 2 comments
Labels
enhancement minor Minor bugs (not high priority) small

Comments

@simonw
Copy link
Owner

simonw commented Feb 28, 2024

I had to do this:

CleanShot 2024-02-27 at 16 01 00@2x

But I'd like to do it more like this - with a "does not contain" filter which does not yet exist:

CleanShot 2024-02-27 at 16 02 03@2x

@simonw simonw added enhancement small minor Minor bugs (not high priority) labels Feb 28, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 28, 2024

Relevant code:

TemplatedFilter(
"not",
"!=",
'"{c}" != :{p}',
lambda c, v: "{c} != {v}" if v.isdigit() else '{c} != "{v}"',
),
TemplatedFilter(
"contains",
"contains",
'"{c}" like :{p}',
'{c} contains "{v}"',
format="%{}%",
),
TemplatedFilter(
"endswith",
"ends with",
'"{c}" like :{p}',
'{c} ends with "{v}"',
format="%{}",
),

@simonw simonw closed this as completed in f99c2f5 Feb 28, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 28, 2024

CleanShot 2024-02-27 at 16 07 16@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement minor Minor bugs (not high priority) small
Projects
None yet
Development

No branches or pull requests

1 participant