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 disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

-- 
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.

Reply via email to