From 67f5a03a4014feed95edf75d165f3cd669041426 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 26 Jul 2013 12:21:21 +0200 Subject: [PATCH] meta helper --- apps/funding/models.py | 3 +++ apps/funding/templates/admin/funding/offer/change_form.html | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/funding/models.py b/apps/funding/models.py index 3a74238e7..0bd5360f9 100644 --- a/apps/funding/models.py +++ b/apps/funding/models.py @@ -124,6 +124,9 @@ class Offer(models.Model): """ QuerySet for all completed payments for the offer. """ return Funding.payed().filter(offer=self) + def funders(self): + return self.funding_payed().order_by('-amount', 'payed_at') + def sum(self): """ The money gathered. """ return self.funding_payed().aggregate(s=models.Sum('amount'))['s'] or 0 diff --git a/apps/funding/templates/admin/funding/offer/change_form.html b/apps/funding/templates/admin/funding/offer/change_form.html index 7b2f6de42..292d0dfeb 100755 --- a/apps/funding/templates/admin/funding/offer/change_form.html +++ b/apps/funding/templates/admin/funding/offer/change_form.html @@ -20,12 +20,12 @@ ↓ {% trans "fundings" %} ↓ - {{ block.super }} {% endblock %} -- 2.20.1