meta helper
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 26 Jul 2013 10:21:21 +0000 (12:21 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 26 Jul 2013 10:21:21 +0000 (12:21 +0200)
apps/funding/models.py
apps/funding/templates/admin/funding/offer/change_form.html

index 3a74238..0bd5360 100644 (file)
@@ -124,6 +124,9 @@ class Offer(models.Model):
         """ QuerySet for all completed payments for the offer. """
         return Funding.payed().filter(offer=self)
 
         """ 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
     def sum(self):
         """ The money gathered. """
         return self.funding_payed().aggregate(s=models.Sum('amount'))['s'] or 0
index 7b2f6de..292d0df 100755 (executable)
 
 
 <a id="generated-switch">↓ {% trans "fundings" %} ↓</a>
 
 
 <a id="generated-switch">↓ {% trans "fundings" %} ↓</a>
-<div id="generated" style="display:none; padding:1em; border: 1px solid #aaa;">
+<div id="generated" style="display:none; padding:1em; border: 1px solid #aaa;">{% spaceless %}
     {% for funding in original.funders %}
         {% if funding.name %}
     {% for funding in original.funders %}
         {% if funding.name %}
-            &lt;dc:contributor.funding>{{ funding.name }}&lt;/dc:contributor.funding><br/>
+            &lt;dc:contributor.funding xml:lang="pl" xmlns:dc="http://purl.org/dc/elements/1.1/">{{ funding.name }}&lt;/dc:contributor.funding><br/>
         {% endif %}
     {% endfor %}
         {% endif %}
     {% endfor %}
-</div>
+{% endspaceless %}</div>
 {{ block.super }}
 {% endblock %}
 {{ block.super }}
 {% endblock %}