On Sun, 2009-02-22 at 19:54 -0800, Chris wrote:
> Sorry, not sure how that happened. My browser wasn't even opened when
> those were sent.
> 
> Anyways, thanks for the suggestion. However, nested if statements (why
> doesn't Django support elif?!) 

Using "elif" wouldn't make things much simpler. They would still a
closing-block tag of some kind (to avoid ambiguous-else resolving). So,
aside from saving a few characters of typing, it's not adding any
functionality.

> and multiple includes still seems very
> awkward. I think I'll try using simple_tag to encapsulate my
> permission logic, and call that for each row.

Which makes sense.  The idea of the template language is to keep things
very simple. If you're needing to do deeply nested structures or
complicated logic, then pushing that into a tag (so that the programming
is in Python, not template language) is the intention.

Remember that although you are also a Python programmer in this case,
the target audience for the template languages are people who are not.
So things like "foo == bar", although arguably on the borderline, is
something that can be abstracted as a tag so that the template author
doesn't need to worry about implementation details. Yes, before you say
it, there are arguments both ways. That's why it's a gray line at the
border between templates and code. But realise that we have to choose
one way or the other in every case. Not everybody's going to agree with
every choice.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to