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

Support lte, gte filtering on attributes #111

Open
onlyphantom opened this issue Mar 17, 2022 · 0 comments
Open

Support lte, gte filtering on attributes #111

onlyphantom opened this issue Mar 17, 2022 · 0 comments

Comments

@onlyphantom
Copy link

First of all, thank you for the work you've done on this!

For a task with a custom UDA such as project duration (duration) in man-days, or number of resources (resources), I think it would be helpful to filter those tasks in a Django ORM-like manner.

Example of the API:

from tasklib import TaskWarrior
tw = TaskWarrior(data_location="~/vaults/tasks")
tw.tasks.pending().get(duration__gte=7)

This will query any pending tasks with a duration value of 7 or more.

This is very consistent to the current behavior as documented officially:

tw.tasks.pending().get(tags__contain='work')

Currently, the work-around is to read all tasks in a for-loop and then do a conditional check, but I thought this would be a much appreciated feature. What do you guys think?

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

No branches or pull requests

1 participant