From e75ae80fb5413f1fb365d091c37ae997d0d48557 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Fri, 29 Mar 2019 17:15:15 +0100 Subject: [PATCH] REST API: Allow to filter orders by datetime --- doc/api/resources/orders.rst | 1 + src/pretix/api/views/order.py | 1 + 2 files changed, 2 insertions(+) diff --git a/doc/api/resources/orders.rst b/doc/api/resources/orders.rst index 3d8c17cf51..6ab3220758 100644 --- a/doc/api/resources/orders.rst +++ b/doc/api/resources/orders.rst @@ -385,6 +385,7 @@ List of all orders :query datetime modified_since: Only return orders that have changed since the given date. Be careful: We only recommend using this in combination with ``testmode=false``, since test mode orders can vanish at any time and you will not notice it using this method. + :query datetime created_since: Only return orders that have been created since the given date. :param organizer: The ``slug`` field of the organizer to fetch :param event: The ``slug`` field of the event to fetch :resheader X-Page-Generated: The server time at the beginning of the operation. If you're using this API to fetch diff --git a/src/pretix/api/views/order.py b/src/pretix/api/views/order.py index 9b9e9134ff..ea9e6ad834 100644 --- a/src/pretix/api/views/order.py +++ b/src/pretix/api/views/order.py @@ -50,6 +50,7 @@ class OrderFilter(FilterSet): code = django_filters.CharFilter(field_name='code', lookup_expr='iexact') status = django_filters.CharFilter(field_name='status', lookup_expr='iexact') modified_since = django_filters.IsoDateTimeFilter(field_name='last_modified', lookup_expr='gte') + created_since = django_filters.IsoDateTimeFilter(field_name='datetime', lookup_expr='gte') class Meta: model = Order