#10689: boolean expressions in the template system's if clause
--------------------------------------+-------------------------------------
Reporter: anonymous | Owner: nobody
Status: closed | Milestone:
Component: Template system | Version: 1.0
Resolution: invalid | Keywords: if boolean and or
binding
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Comment (by kmtracey):
Replying to [comment:2 anonymous]:
> Sorry, actually i was wrong, "and" binds stronger, if you dont believe
me you can look it up yourself:
docs.python.org/reference/expressions.html#summary
>
> Anyway: the order of logic is *not* ambiguous and disallowing
expressions with and/or combinations for this reason is majorly wrong.
The fact that you got it wrong in the initial description rather proves
the point Russell mentioned. A non-programmer template designer isn't
likely to know intuitively which binds more strongly, even a programmer
may have to look it up. Sure, technically the "ambiguity" is defined away
by the language specifying the precedence, but the point is expressions
involving combined ands and ors are likely ambiguous to the general
intended audience of template readers/writers, therefore such expressions
are not allowed. You may disagree with the "understandable to non-
programmers" goal of Django templates, but you cannot, after getting the
precedence wrong yourself, logically argue that this design decision
doesn't help achieve that goal.
--
Ticket URL: <http://code.djangoproject.com/ticket/10689#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---