Alex Gaynor wrote:
On Wed, Feb 10, 2010 at 12:10 PM, megaman821 <megaman...@gmail.com> wrote:
Since Django 1.2 is not out yet I have been using the smart_if tag in
all my projects, with one addition. Since I believe the new if tag is
based on the smart_if tag code on Django Snippets, I want to propose
adding the mod(%) operator to it.
Often I have display logic where I am displaying a grid of items so
every nth item I need to create a new row. Right now you can awkwardly
do this with the cycle tag but it gets a bit tedious and error prone
if you want to have a row of 10 items. For example, you could do:
{% cycle '' '' '' '' '' '' '' '' '' '<br />' %}
or
{% if forloop.counter % 10 %}
<br />
{% endif %}
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.
Isn't this solved by the |divisibleby filter?
Alex
I'm not sure if this was discussed before, but what about allowing to
easily register custom comparison operators? I'm thinking of a similar
API we currently have for registering template tags/filters for if-tag
operators.
Jonas
--
You received this message because you are subscribed to the Google Groups "Django
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.