On Tue, May 3, 2011 at 2:24 AM, Phui Hock <[email protected]> wrote: > Hi, > It always frustrates me when I must resort to custom filter to do > simple math to achieve some special-case markups (eg. applying a row > tag around 5 items max for a list of objects). > > Do you think a math tag like this that I just published to > djangosnippets.org can be made into the default list of tags? > http://djangosnippets.org/snippets/2424/
This stems back to the design motivation of Django's template language -- you shouldn't be doing math in the template. Instead, you should be doing your math in the view, and providing the template with a pre-calculated result. So, my inclination would be to say no, this doesn't have a place in the default list of tags. Yours, Russ Magee %-) -- 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.
