On Tue, 03 May 2011 06:59:02 +0300, Phui Hock <[email protected]> wrote:
Holy god, not to be rude, but given that this is completely unreadable
I'm
even more -1 than I ever would have been on the basis of the principle
of a
dumber template language.
Alex
My apologies. All that is doing is rendering the following result when
the URL is http://localhost:8001/?x=2&y=3&z=4
if x = 2, y = 3, 2 + 3 = 6
if x = 2, y = 3, 2 * 3 = 6
if x = 2, y = 3, z = 4, (2^4) * (3^4) = 1296
if x = 2, y = 3, z = 4, (2 + 3) / 4 = 1
While I think there are common display issues that require a little more
than the current tags, this example is the exact opposite. This is exactly
the case where the math should be done in the view, never in the template.
What if you want to display these calcs in a table, or in a <UL> tag? Copy
the entire template over and change the tags?
Cases for display logic include, off the top of my head:
- substract, mainly for knowing how much width is left in some element for
display (total width - sum of widths for some elements we loop through)
- multiply (again, width calculations)
- divide + remainder - supplements divisibleby in cases you need to know
the size of the tail you're left with
But I can't think of any such use for stuff like pow (^), or even complex
parenthesized expressions.
Yishai
--
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.