On 09/19/2011 12:58 PM, skazhy wrote:
Hi all!I've been working with Django for a while now, but today I decided to make a first contribution to Django that would make templates less ugly by adding these two values to loop_dict (in django/template/ defaulttags.py): loop_dict['even'] = (i %2 == 0) loop_dict['odd'] = (i %2 != 0) Using {% if forloop.even %} would be more clear and readable than {% if forloop|divisibleby:"2" %}. As I am new to working *on* Django I don't know the history of this idea (if there is one) and the correct way of sending patches, all comments (and corrections!) are appreciated! -Karlis Lauva /skazhy/
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatetag-cycle -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
