Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-09 Thread Django
#17348: Implement {% elif %} in the template language
-+-
 Reporter:  aaugustin|Owner:  aaugustin
 Type:  New feature  |   Status:  closed
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [17187]:
 {{{
 #!CommitTicketReference repository="" revision="17187"
 Fixed #17348 -- Implemented {% elif %}. Refs #3100.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-09 Thread Django
#17348: Implement {% elif %} in the template language
-+-
 Reporter:  aaugustin|Owner:  aaugustin
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by aaugustin):

 Attached patch implements `{% elif %}`. It complements 3100-backwards-
 compatible.patch from #3100.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-08 Thread Django
#17348: Implement {% elif %} in the template language
-+-
 Reporter:  aaugustin|Owner:  aaugustin
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by aaugustin):

 * owner:  nobody => aaugustin


-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-07 Thread Django
#17348: Implement {% elif %} in the template language
-+
 Reporter:  aaugustin|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by russellm):

 @aaugustin -- Count me as +1 on this; I can't see any argument where
 massively nested ifs are preferable to a flat series of {% elif %}
 statements. I don't think this increases the amount of logic in a
 template; it just makes the logic that we've already allowed slightly more
 friendly.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-07 Thread Django
#17348: Implement {% elif %} in the template language
-+
 Reporter:  aaugustin|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by mitar):

 * cc: mmitar@… (added)


-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17348: Implement {% elif %} in the template language

2011-12-07 Thread Django
#17348: Implement {% elif %} in the template language
-+
 Reporter:  aaugustin|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * version:   => SVN
 * stage:  Unreviewed => Accepted
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 #3100 is about supporting arguments on intermediate tag tokens, and it's a
 pre-requisite for this ticket.

 Here are the arguments I saw on IRC.

 Pros:

 - templates should be able to express presentational logic: for instance,
 depending of an object's state, I want to show different properties
 - the most straightforward workaround is messy: `{% if a %} ... {% else
 %}{% if b %} ... {% else %}{% if c %} ... {% endif %}{% endif %}{% endif
 %}`
 - a more elaborate workaround involves partial templates, e.g. `{% include
 myobj.state_template %}` where state_template returns
 `"partials/state_.html"`, but that's overkill for simple cases

 Cons:

 - templates shouldn't contain too much logic — that's a well understood
 design choice
 - increasing the amount of logic in the templates doesn't help us fight
 performance issues

 Tentatively marking as accepted, please bump back to DDN if you disagree.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.