From b76cc2ed642c55f4b07cf23b7b49eb007400b51c Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Thu, 22 Jul 2021 07:55:58 +0200 Subject: [PATCH] remove wrong info for now --- src/backoffice/templates/ticket_stats.html | 6 +----- src/tickets/models.py | 8 ++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/backoffice/templates/ticket_stats.html b/src/backoffice/templates/ticket_stats.html index ca2715a1..ecf34f02 100644 --- a/src/backoffice/templates/ticket_stats.html +++ b/src/backoffice/templates/ticket_stats.html @@ -14,9 +14,7 @@ Ticket Type - Number Sold - Total Income - Average Price + Tickets Generated Products @@ -25,8 +23,6 @@ {{ tt.name }} {{ tt.shopticket_count }} - {{ tt.total_price|floatformat:"2" }} DKK - {{ tt.average_price|floatformat:"2" }} DKK {{ tt.product_set.count }} {% endfor %} diff --git a/src/tickets/models.py b/src/tickets/models.py index 767e4271..7680da51 100644 --- a/src/tickets/models.py +++ b/src/tickets/models.py @@ -18,12 +18,8 @@ logger = logging.getLogger("bornhack.%s" % __name__) class TicketTypeManager(models.Manager): def with_price_stats(self): - return ( - self.annotate(shopticket_count=models.Count("shopticket")) - .annotate(average_price=models.Avg("shopticket__product__price")) - .annotate(total_price=models.Sum("shopticket__product__price")) - .exclude(shopticket_count=0) - .order_by("total_price") + return self.annotate(shopticket_count=models.Count("shopticket")).exclude( + shopticket_count=0 )