From: Radek Czajka Date: Fri, 26 Jul 2013 10:21:21 +0000 (+0200) Subject: meta helper X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/67f5a03a4014feed95edf75d165f3cd669041426?ds=sidebyside meta helper --- 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 %}