Re: [Django] #14240: filesizeformat should localize number

2011-01-05 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:  
blocker  
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Comment (by David Danier ):

 Updated patch to current revision.

 In addition I noticed, that my fallback-output-fix used the variable bytes
 when calling ungettext, which of course looks like nonsense. This is
 changed now.

-- 
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-upda...@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] #14240: filesizeformat should localize number

2011-01-05 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:  
blocker  
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * keywords:  => blocker

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-11-14 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by David Danier ):

  * needs_tests:  1 => 0

Comment:

 I attached an updated patch including:
  * Use of round() in filesizeformat(). This should be ok, as all numbers
 are converted to float first, so we don't need to handle
 Decimal.quantize().
  * Fix of fallback-output, which is currently not localized ("0 bytes",
 see except, 0 might be singular in some languages or something totally
 different, who knows)
  * Added tests, thanks Russel for the pointer.
  * Updated myself in AUTHORS

 About round(): I think just cutting of the last digits inside
 number_format() should be the intended behaviour. number_format() should
 not care about doing something other than just formatting the number. So
 round() must be called outside of number_format(). Perhaps Django could
 provide some generic round()-function to accomplish differences betweeen
 float and Decimal, but thats definately outside the scope of this ticket
 and number_format.

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-10-29 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  1 
   
Needs_better_patch:  0  |  
+---
Comment (by russellm):

 The rc1 patch on #14181 should give you an idea of how to handle testing
 of this feature.

 What you describe certainly sounds like a problem; however, it should be
 tracked as a separate ticket.

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-10-08 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  1 
   
Needs_better_patch:  0  |  
+---
Comment (by David Danier ):

 I'm not sure how to write these. Can you point me into the right
 direction? My first attempt on putting tests into
 regressiontests.defaultfilters seems to have failed because USE_I18N
 and/or USE_L10N is set to False. Then I discovered regressiontests.i18n,
 but there are no filter-tests in there (or at least I haven't found them).

 Apart from that: It seems like formats.number_format() just strips of the
 last digits if the float/decimal has to much decimal places. So some
 existing tests fail using the above patch as 1023.999something will result
 in "1023,9" instead of "1024.0". Is this the intended behavior of
 formats.number_format()? If so I will try to update the patch.

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-10-08 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  1 
   
Needs_better_patch:  0  |  
+---
Changes (by russellm):

  * needs_docs:  1 => 0
  * needs_tests:  0 => 1

Comment:

 A reasonable suggestion, but the patch needs tests.

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-09-10 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  1  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by anonymous):

  * needs_docs:  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-upda...@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] #14240: filesizeformat should localize number

2010-09-10 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
anonymous
Status:  assigned   | Milestone:
   
 Component:  Template system|   Version:  
1.2  
Resolution: |  Keywords:
   
 Stage:  Accepted   | Has_patch:  1 
   
Needs_docs:  0  |   Needs_tests:  0 
   
Needs_better_patch:  0  |  
+---
Changes (by anonymous):

  * owner:  nobody => anonymous
  * status:  new => assigned
  * component:  Uncategorized => Template system
  * stage:  Unreviewed => Accepted

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-09-09 Thread Django
#14240: filesizeformat should localize number
+---
  Reporter:  David Danier   | Owner:  
nobody
Status:  new| Milestone:

 Component:  Uncategorized  |   Version:  
1.2   
Resolution: |  Keywords:

 Stage:  Unreviewed | Has_patch:  1 

Needs_docs:  0  |   Needs_tests:  0 

Needs_better_patch:  0  |  
+---
Changes (by David Danier ):

  * needs_better_patch:  => 0
  * has_patch:  0 => 1
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
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-upda...@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] #14240: filesizeformat should localize number

2010-09-09 Thread Django
#14240: filesizeformat should localize number
---+
 Reporter:  David Danier   |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.2   
 Keywords: |   Stage:  Unreviewed
Has_patch:  0  |  
---+
 Currently filesizeformat always displays file size in english number
 formating. But as we now have formats.number_format() I think this should
 be used. Possible example:

 {{{
 In [1]: from django.template.defaultfilters import filesizeformat

 In [2]: filesizeformat(100)
 Out[2]: u'100 bytes'

 In [3]: filesizeformat(1000)
 Out[3]: u'1000 bytes'

 In [4]: filesizeformat(2000)
 Out[4]: u'1.9 KB'

 In [5]: filesizeformat(15000)
 Out[5]: u'14.6 KB'

 In [6]: from django.utils import translation

 In [7]: translation.activate('de')

 In [8]: filesizeformat(15000)
 Out[8]: u'14,6 KB'

 In [9]: filesizeformat(150)
 Out[9]: u'1,4 MB'

 In [10]: filesizeformat(15)
 Out[10]: u'1,3 GB'

 In [11]: filesizeformat(15000)
 Out[11]: u'1,3 TB'
 }}}

 Patch follows.

-- 
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-upda...@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.