Re: [Django] #11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0

2011-12-17 Thread Django
#11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0
-+
 Reporter:  luddep   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  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 [17224]:
 {{{
 #!CommitTicketReference repository="" revision="17224"
 Fixed #11166 -- {% widthratio %} should return 0 when the maximum is 0, no
 matter the value.
 }}}

-- 
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] #11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0

2011-12-17 Thread Django
#11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0
-+
 Reporter:  luddep   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  SVN
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by aaugustin):

 * ui_ux:   => 0
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 I agree that the empty string is technically the "correct" output (the
 template engine returns nothing whenever an exception occurs), but that in
 this case "practicality beats purity".

-- 
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] #11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0

2009-06-16 Thread Django
#11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0
-+--
  Reporter:  luddep  | Owner:  nobody
Status:  new | Milestone:
 Component:  Template system |   Version:  SVN   
Resolution:  |  Keywords:
 Stage:  Design decision needed  | Has_patch:  1 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by SmileyChris):

  * stage:  Unreviewed => Design decision needed

-- 
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] #11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0

2009-05-20 Thread Django
#11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0
--+-
  Reporter:  luddep   | Owner:  nobody
Status:  new  | Milestone:
 Component:  Template system  |   Version:  SVN   
Resolution:   |  Keywords:
 Stage:  Unreviewed   | Has_patch:  1 
Needs_docs:  0|   Needs_tests:  0 
Needs_better_patch:  0|  
--+-
Changes (by luddep):

  * needs_better_patch:  => 0
  * component:  Uncategorized => Template system
  * needs_tests:  => 0
  * version:  1.0 => SVN
  * needs_docs:  => 0
  * has_patch:  0 => 1

-- 
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
-~--~~~~--~~--~--~---



[Django] #11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0

2009-05-20 Thread Django
#11166: {% widthratio 0 0 100 %} returns an empty string, rather than a 0
---+
 Reporter:  luddep |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.0   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 When supplying the {% widthratio %} template tag with both a value and max
 of 0 - you get an empty string returned (''), rather than a 0.
 Mathematically, this is correct - since typically division by zero results
 in undefined, but I wouldn't say this is the expected behaviour when using
 this to create charts, where a 0 rather than nothing, would be expected.

 Example:
 {{{
 
 
 }}}

 This would produce:
 {{{
 
 
 }}}

 Now, in the first example, the difference is only semantic - but the
 second one creates invalid css as well, not such a big of a deal, but,
 gets troublesome when you *need* a number returned, such as when using {%
 widthratio %} with the google charts api. (sparklines, for example,
 require a number between 0-100 - anything above 100, such as 550, is
 visually returned as 100 in the chart - so you can't have empty values.)

 But, when would anyone ever encounter this problem? I personally do when
 displaying data over a time period, where in some cases, nothing may have
 happened - leaving everything at 0, both the values and max values - which
 then results in everything showing up empty, rather than defaulting back
 to 0.

 I realize this is easy to work around, but I thought I would put it out
 there since at least I wasn't expecting this behavior and it seems a bit
 weird, especially when this is mainly used to create charts in templates.

 (Patch is for the latest svn checkout as of this writing, rev 10833)

-- 
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
-~--~~~~--~~--~--~---