ich will, das die Förderung Zählung heraus filtern undWie Wörterbuch in django Vorlage verwendet
hier für diese bestimmte Zählung des service_type und Promotion-Code speichern ist meine Ansicht
promotions=Promotions.objects.filter(member=request.user)
dictt={}
for promotion in promotions:
c=customer_request.objects.filter(promotion=promotion)
e=c.count()
dictt[e]=e
for w in c:
coupon_code=Promotions.objects.get(pk=w.promotion_id)
dictt.update({e:{coupon_code.coupon_code,w.service_type}})
sorted_dictt = sorted(dictt.items(), key=operator.itemgetter(0), reverse=True)
und ich bin Anzeige dict auf html als
{% for a in sorted_dictt %}
<tr>
<td style="color:#f38619;"></td>
<td style="color:#f38619;">{{a.1}}</td>
<td style="color:#f38619;">{{a.0}}</td>
</tr>
{%endfor%}
jetzt folgt ich erhalte Ergebnisse als:
sollte Anzeige als
, wie es zu tun?
Verwendung a.1.0 und A.1.1 – dnit13