Commit 023d8cb3 authored by Luuk Scholten's avatar Luuk Scholten
Browse files

Merge branch '136-default-order-pizzas' into 'master'

Betere default sorteringen voor pizzas in orders en overview

Closes #136

See merge request !344
parents cf5f5699 e56fc85d
......@@ -24,7 +24,7 @@
</tr>
</thead>
<tbody>
{% for product in product_list.values %}
{% for product in product_list %}
<tr>
<td>
{{ product.name }}
......
......@@ -28,7 +28,8 @@ def orders(request, event_pk):
event = get_object_or_404(PizzaEvent, pk=event_pk)
context = {'event': event,
'orders': Order.objects.filter(pizza_event=event)
.prefetch_related('member', 'product')}
.prefetch_related('member', 'product')
.order_by('member__user__first_name')}
return render(request, 'pizzas/orders.html', context)
......@@ -55,6 +56,8 @@ def overview(request, event_pk):
total_products += 1
total_money += order.product.price
product_list = sorted(product_list.values(), key=lambda x: x['name'])
context = {
'event': event,
'product_list': product_list,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment