>
> Or, in a sane world:
>
> if x = {{ x }}, y = {{ y }},  {{ x }} + {{ y }} = {{ x_plus_y_res }}
> if x = {{ x }}, y = {{ y }}, {{ x }} * {{ y }} = {{ x_star_y_res }}
>
> and so on.
>

While it is a common consensus that logic should never be in the template,
the "solution" on the other hand is inconvenient at best.

I must admit the examples are badly written and do not reflect the actual
problem. The point here though, is that a general purpose math tag should be
available by default. *The* math tag may be too flexible for its own good.
If we have a dumber solution, I'm fine with that so long it supports the
simplest cases, and that would be + - * / % min max and ().

One real world problem that I always have is trying to output Javascript
with Django template. Precomputing the values inside the view and pass them
into the template is annoyingly redundant when the values can be derived
from other objects in the context.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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