Tuesday, January 26, 2016

Re: count

Hi

> i am trying to count the number of fields that has request field begin
> checked and then display the value of count in a template.html but i am not
> sure how to go about doing that.

If you pass your object to the template you can use the "length" filter:

{{ test|length }}

Andreas

--
Kurs 10 IT-Consulting www.kurs-10.de
Andreas Schosser a@kurs-10.de

Baldestraße. 14 Telefon +49 89 41615842-0
80469 München Telefax +49 89 41615842-3

0x6EDECCF1 - 2AA0 939B 5585 819B FCE8 E43B 0B8E 0DF2 6EDE CCF1

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/56A77EE6.7030205%40kurs-10.de.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment