forked from CGM_Public/pretix_original
Force ordering of events on dashboard
This commit is contained in:
@@ -4,6 +4,10 @@ pretixdroid HTTP API
|
|||||||
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
|
The pretixdroid plugin provides a HTTP API that the `pretixdroid Android app`_
|
||||||
uses to communicate with the pretix server.
|
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/
|
.. http:post:: /pretixdroid/api/(organizer)/(event)/redeem/
|
||||||
|
|
||||||
Redeems a ticket, i.e. checks the user in.
|
Redeems a ticket, i.e. checks the user in.
|
||||||
@@ -19,6 +23,12 @@ uses to communicate with the pretix server.
|
|||||||
|
|
||||||
secret=az9u4mymhqktrbupmwkvv6xmgds5dk3
|
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**:
|
**Example successful response**:
|
||||||
|
|
||||||
.. sourcecode:: http
|
.. sourcecode:: http
|
||||||
@@ -51,9 +61,9 @@ uses to communicate with the pretix server.
|
|||||||
* ``unknown_ticket`` - Secret does not match a ticket in the database
|
* ``unknown_ticket`` - Secret does not match a ticket in the database
|
||||||
|
|
||||||
:query key: Secret API key
|
:query key: Secret API key
|
||||||
:statuscode 200: Valid request
|
:statuscode 200: Valid request
|
||||||
:statuscode 404: Unknown organizer or event
|
:statuscode 404: Unknown organizer or event
|
||||||
:statuscode 403: Invalid authorization key
|
:statuscode 403: Invalid authorization key
|
||||||
|
|
||||||
.. http:get:: /pretixdroid/api/(organizer)/(event)/search/
|
.. 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 404: Unknown organizer or event
|
||||||
:statuscode 403: Invalid authorization key
|
: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/
|
.. http:get:: /pretixdroid/api/(organizer)/(event)/status/
|
||||||
|
|
||||||
Returns status information, such as the total number of tickets and the
|
Returns status information, such as the total number of tickets and the
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ def user_event_widgets(**kwargs):
|
|||||||
user = kwargs.pop('user')
|
user = kwargs.pop('user')
|
||||||
widgets = []
|
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:
|
for event in events:
|
||||||
widgets.append({
|
widgets.append({
|
||||||
'content': '<div class="event">{event}<span class="from">{df}</span><span class="to">{dt}</span></div>'.format(
|
'content': '<div class="event">{event}<span class="from">{df}</span><span class="to">{dt}</span></div>'.format(
|
||||||
|
|||||||
Reference in New Issue
Block a user