Commit 5feb1d84 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

[mod] put __in everywhere

parent 2c134dd8
......@@ -43,12 +43,12 @@ def total_addition_from_free_price(orders):
@register.simple_tag
def count_in_current_group_order(component, orders):
return component.componentorder_set.filter(order=orders).aggregate(Sum('number'))['number__sum']
return component.componentorder_set.filter(order__in=orders).aggregate(Sum('number'))['number__sum']
@register.simple_tag
def prices_in_current_group_order(component, orders):
prices = set([x.price for x in component.componentorder_set.filter(order=orders)])
prices = set([x.price for x in component.componentorder_set.filter(order__in=orders)])
if len(prices) == 1:
for i in prices:
return i
......
......@@ -15,7 +15,7 @@ def dashboard(request):
def group_order_detail(request, pk):
group_order = get_object_or_404(GroupOrder, pk=pk)
orders = group_order.order_set.all()
components = Component.objects.filter(componentorder__order=orders).distinct()
components = Component.objects.filter(componentorder__order__in=orders).distinct()
providers = set()
for component in components:
......
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