mirror of
https://github.com/pretix/pretix.git
synced 2026-08-10 10:47:00 +00:00
API: Allow to filter orders by customer
This commit is contained in:
@@ -135,6 +135,10 @@ last_modified datetime Last modificati
|
|||||||
|
|
||||||
The ``event`` attribute has been added. The organizer-level endpoint has been added.
|
The ``event`` attribute has been added. The organizer-level endpoint has been added.
|
||||||
|
|
||||||
|
.. versionchanged:: 2023.9
|
||||||
|
|
||||||
|
The ``customer`` query parameter has been added.
|
||||||
|
|
||||||
|
|
||||||
.. _order-position-resource:
|
.. _order-position-resource:
|
||||||
|
|
||||||
@@ -420,6 +424,7 @@ List of all orders
|
|||||||
:query string code: Only return orders that match the given order code
|
:query string code: Only return orders that match the given order code
|
||||||
:query string status: Only return orders in the given order status (see above)
|
:query string status: Only return orders in the given order status (see above)
|
||||||
:query string search: Only return orders matching a given search query (matching for names, email addresses, and company names)
|
:query string search: Only return orders matching a given search query (matching for names, email addresses, and company names)
|
||||||
|
:query string customer: Only show orders linked to the given customer.
|
||||||
:query integer item: Only return orders with a position that contains this item ID. *Warning:* Result will also include orders if they contain mixed items, and it will even return orders where the item is only contained in a canceled position.
|
:query integer item: Only return orders with a position that contains this item ID. *Warning:* Result will also include orders if they contain mixed items, and it will even return orders where the item is only contained in a canceled position.
|
||||||
:query integer variation: Only return orders with a position that contains this variation ID. *Warning:* Result will also include orders if they contain mixed items and variations, and it will even return orders where the variation is only contained in a canceled position.
|
:query integer variation: Only return orders with a position that contains this variation ID. *Warning:* Result will also include orders if they contain mixed items and variations, and it will even return orders where the variation is only contained in a canceled position.
|
||||||
:query boolean testmode: Only return orders with ``testmode`` set to ``true`` or ``false``
|
:query boolean testmode: Only return orders with ``testmode`` set to ``true`` or ``false``
|
||||||
@@ -1566,6 +1571,7 @@ List of all order positions
|
|||||||
``order__datetime,positionid``
|
``order__datetime,positionid``
|
||||||
:query string order: Only return positions of the order with the given order code
|
:query string order: Only return positions of the order with the given order code
|
||||||
:query string search: Fuzzy search matching the attendee name, order code, invoice address name as well as to the beginning of the secret.
|
:query string search: Fuzzy search matching the attendee name, order code, invoice address name as well as to the beginning of the secret.
|
||||||
|
:query string customer: Only show orders linked to the given customer.
|
||||||
:query integer item: Only return positions with the purchased item matching the given ID.
|
:query integer item: Only return positions with the purchased item matching the given ID.
|
||||||
:query integer item__in: Only return positions with the purchased item matching one of the given comma-separated IDs.
|
:query integer item__in: Only return positions with the purchased item matching one of the given comma-separated IDs.
|
||||||
:query integer variation: Only return positions with the purchased item variation matching the given ID.
|
:query integer variation: Only return positions with the purchased item variation matching the given ID.
|
||||||
|
|||||||
@@ -110,10 +110,11 @@ with scopes_disabled():
|
|||||||
item = django_filters.CharFilter(field_name='all_positions', lookup_expr='item_id', distinct=True)
|
item = django_filters.CharFilter(field_name='all_positions', lookup_expr='item_id', distinct=True)
|
||||||
variation = django_filters.CharFilter(field_name='all_positions', lookup_expr='variation_id', distinct=True)
|
variation = django_filters.CharFilter(field_name='all_positions', lookup_expr='variation_id', distinct=True)
|
||||||
subevent = django_filters.CharFilter(field_name='all_positions', lookup_expr='subevent_id', distinct=True)
|
subevent = django_filters.CharFilter(field_name='all_positions', lookup_expr='subevent_id', distinct=True)
|
||||||
|
customer = django_filters.CharFilter(field_name='customer__identifier')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Order
|
model = Order
|
||||||
fields = ['code', 'status', 'email', 'locale', 'testmode', 'require_approval']
|
fields = ['code', 'status', 'email', 'locale', 'testmode', 'require_approval', 'customer']
|
||||||
|
|
||||||
@scopes_disabled()
|
@scopes_disabled()
|
||||||
def subevent_after_qs(self, qs, name, value):
|
def subevent_after_qs(self, qs, name, value):
|
||||||
|
|||||||
Reference in New Issue
Block a user