mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Merge pull request #101 from cherti/readability
improved top-to-bottom-adhoc-readability
This commit is contained in:
@@ -88,69 +88,69 @@ class JSONExporter(BaseExporter):
|
|||||||
},
|
},
|
||||||
'categories': [
|
'categories': [
|
||||||
{
|
{
|
||||||
'id': c.identity,
|
'id': category.identity,
|
||||||
'name': str(c.name)
|
'name': str(category.name)
|
||||||
} for c in self.event.categories.current.all()
|
} for category in self.event.categories.current.all()
|
||||||
],
|
],
|
||||||
'items': [
|
'items': [
|
||||||
{
|
{
|
||||||
'id': i.identity,
|
'id': item.identity,
|
||||||
'name': str(i.name),
|
'name': str(item.name),
|
||||||
'category': i.category_id,
|
'category': item.category_id,
|
||||||
'price': i.default_price,
|
'price': item.default_price,
|
||||||
'admission': i.admission,
|
'admission': item.admission,
|
||||||
'active': i.active,
|
'active': item.active,
|
||||||
'variations': [
|
'variations': [
|
||||||
{
|
{
|
||||||
'id': v.identity,
|
'id': variation.identity,
|
||||||
'active': v.active,
|
'active': variation.active,
|
||||||
'price': v.default_price if v.default_price is not None else i.default_price,
|
'price': variation.default_price if variation.default_price is not None else item.default_price,
|
||||||
'name': str(v)
|
'name': str(variation)
|
||||||
} for v in i.variations.current.all()
|
} for variation in item.variations.current.all()
|
||||||
]
|
]
|
||||||
} for i in self.event.items.current.all().prefetch_related('variations')
|
} for item in self.event.items.current.all().prefetch_related('variations')
|
||||||
],
|
],
|
||||||
'questions': [
|
'questions': [
|
||||||
{
|
{
|
||||||
'id': q.identity,
|
'id': question.identity,
|
||||||
'question': str(q.question),
|
'question': str(question.question),
|
||||||
'type': q.type
|
'type': question.type
|
||||||
} for q in self.event.questions.current.all()
|
} for question in self.event.questions.current.all()
|
||||||
],
|
],
|
||||||
'orders': [
|
'orders': [
|
||||||
{
|
{
|
||||||
'code': o.code,
|
'code': order.code,
|
||||||
'status': o.status,
|
'status': order.status,
|
||||||
'user': o.user.email,
|
'user': order.user.email,
|
||||||
'datetime': o.datetime,
|
'datetime': order.datetime,
|
||||||
'payment_fee': o.payment_fee,
|
'payment_fee': order.payment_fee,
|
||||||
'total': o.total,
|
'total': order.total,
|
||||||
'positions': [
|
'positions': [
|
||||||
{
|
{
|
||||||
'id': p.identity,
|
'id': position.identity,
|
||||||
'item': p.item_id,
|
'item': position.item_id,
|
||||||
'variation': p.variation_id,
|
'variation': position.variation_id,
|
||||||
'price': p.price,
|
'price': position.price,
|
||||||
'attendee_name': p.attendee_name,
|
'attendee_name': position.attendee_name,
|
||||||
'answers': [
|
'answers': [
|
||||||
{
|
{
|
||||||
'question': a.question_id,
|
'question': answer.question_id,
|
||||||
'answer': a.answer
|
'answer': answer.answer
|
||||||
} for a in p.answers.all()
|
} for answer in position.answers.all()
|
||||||
]
|
]
|
||||||
} for p in o.positions.current.all()
|
} for position in order.positions.current.all()
|
||||||
]
|
]
|
||||||
} for o in
|
} for order in
|
||||||
self.event.orders.current.all().prefetch_related('positions', 'positions__answers').select_related(
|
self.event.orders.current.all().prefetch_related('positions', 'positions__answers').select_related(
|
||||||
'user')
|
'user')
|
||||||
],
|
],
|
||||||
'quotas': [
|
'quotas': [
|
||||||
{
|
{
|
||||||
'id': q.identity,
|
'id': quota.identity,
|
||||||
'size': q.size,
|
'size': quota.size,
|
||||||
'items': [i.id for i in q.items.all()],
|
'items': [item.id for item in quota.items.all()],
|
||||||
'variations': [v.id for v in q.variations.all()],
|
'variations': [variation.id for variation in quota.variations.all()],
|
||||||
} for q in self.event.quotas.current.all().prefetch_related('items', 'variations')
|
} for quota in self.event.quotas.current.all().prefetch_related('items', 'variations')
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user