GrafeasGroup / blossom

The website. The app. The everything.
6 stars 3 forks source link

Add `before` and `after` query parameters to the `transcription` endpoint #155

Open TimJentzsch opened 3 years ago

TimJentzsch commented 3 years ago

It would be nice to have optional before and after query parameters for the transcription endpoint, that enable to filter the results by a timeframe.

For example, https://grafeas.org/api/transcription/?after=2021-06-02 would only return transcriptions that were submitted after June 2nd.

This is for example necessary to implement the /progress command for buttercup (GrafeasGroup/buttercup#23), as it needs to count the transcriptions written in the last 24 hours.

TimJentzsch commented 3 years ago

This can probably be achieved by adding a custom FilterBackend: https://www.django-rest-framework.org/api-guide/filtering/