X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/29498b1fa402cb0144193dd809cc84e6b4177ef0..67f5a03a4014feed95edf75d165f3cd669041426:/apps/funding/models.py 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