Date filters in Pulp are ambiguous and a bit of a misnomer
We have a few filters in Pulp for filtering tasks, repo verisons, etc and they usually have names like "started_after". If I have a task that started at say "12:00" and I filter started_after=12:00, then I get the task back because it's filtering on started_at__gte. That seems wrong to me. At the very least, we should have docs that call out that started_after includes the time specified.
edit: The amended proposal is to remove "started_after" "finished_before" etc. filtering params entirely, and to make the underlying "started_at" and "finished_at" fields filterable using normal queries such as "/tasks/?started_at__lte=..."
#2 Updated by dalley over 1 year ago
I'm glad you posted this, and I have some general frustration about it.
On the Task model serializer, we have the following fields:
And the Task viewset filter params are:
If you look at a Task record, you might expect that you could perform a query such as "/tasks/?started_at__gte=..." but you cannot, because we've opted for entirely different names: "started_before", "finished_after", etc.
Likewise, on the RepositoryVersion serializer:
But on the viewset, the filter params:
I don't like the inconsistency between the parameters we're providing to filter by and the actual names of the fields. I propose to delete "*_after" and "*_before" filters entirely, in favor of using normal conventions like e.g. "/tasks/?finished_at__lte=..."
Please register to edit this issue