diff --git a/doc/plugins/pretixdroid.rst b/doc/plugins/pretixdroid.rst index e0a5db573b..89990c9a02 100644 --- a/doc/plugins/pretixdroid.rst +++ b/doc/plugins/pretixdroid.rst @@ -4,6 +4,10 @@ pretixdroid HTTP API The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_ uses to communicate with the pretix server. +.. warning:: This API is intended **only** to serve the pretixdroid Android app. There are no backwards compatibility + guarantees on this API. We will not add features that are not required for the Android App. There will be + a proper general-use API for pretix at a later point in time. + .. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/ Redeems a ticket, i.e. checks the user in. @@ -19,6 +23,12 @@ uses to communicate with the pretix server. secret=az9u4mymhqktrbupmwkvv6xmgds5dk3 + You can optionally include the additional parameter ``datetime`` in the body containing an ISO8601-encoded + datetime of the entry attempt. If you don't, the current date and time will be used. + + You can optionally include the additional parameter ``force`` to indicate that the request should be logged + regardless of previous check-ins for the same ticket. This might be useful if you made the entry decision offline. + **Example successful response**: .. sourcecode:: http @@ -51,9 +61,9 @@ uses to communicate with the pretix server. * ``unknown_ticket`` - Secret does not match a ticket in the database :query key: Secret API key - :statuscode 200: Valid request - :statuscode 404: Unknown organizer or event - :statuscode 403: Invalid authorization key + :statuscode 200: Valid request + :statuscode 404: Unknown organizer or event + :statuscode 403: Invalid authorization key .. http:get:: /pretixdroid/api/(organizer)/(event)/search/ @@ -97,6 +107,46 @@ uses to communicate with the pretix server. :statuscode 404: Unknown organizer or event :statuscode 403: Invalid authorization key +.. http:get:: /pretixdroid/api/(organizer)/(event)/download/ + + Download data for all tickets. + + **Example request**: + + .. sourcecode:: http + + GET /pretixdroid/api/demoorga/democon/download/?key=ABCDEF HTTP/1.1 + Host: demo.pretix.eu + Accept: application/json, text/javascript + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: text/json + + { + "results": [ + { + "secret": "az9u4mymhqktrbupmwkvv6xmgds5dk3", + "order": "ABCE6", + "item": "Standard ticket", + "variation": null, + "attendee_name": "Peter Higgs", + "redeemed": false, + "paid": true + }, + ... + ], + "version": 2 + } + + :query key: Secret API key + :statuscode 200: Valid request + :statuscode 404: Unknown organizer or event + :statuscode 403: Invalid authorization key + .. http:get:: /pretixdroid/api/(organizer)/(event)/status/ Returns status information, such as the total number of tickets and the diff --git a/src/pretix/control/views/dashboards.py b/src/pretix/control/views/dashboards.py index e0e489e2a5..ad3fdb0bcb 100644 --- a/src/pretix/control/views/dashboards.py +++ b/src/pretix/control/views/dashboards.py @@ -244,7 +244,7 @@ def user_event_widgets(**kwargs): user = kwargs.pop('user') widgets = [] - events = user.get_events_with_any_permission().select_related('organizer') + events = user.get_events_with_any_permission().order_by('-date_from', 'name').select_related('organizer') for event in events: widgets.append({ 'content': '
{event}{df}{dt}
'.format(