Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2015-01-14 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  closed
Component:  Utilities   |  Version:  1.8alpha1
 Severity:  Release blocker |   Resolution:  fixed
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by collinanderson):

 Ok, here's a rough failing test case demonstrating my issue:
 https://github.com/django/django/pull/3921

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5715b849128ee254a2e7e75165e70986%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2015-01-14 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  closed
Component:  Utilities   |  Version:  1.8alpha1
 Severity:  Release blocker |   Resolution:  fixed
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by timgraham):

 I don't see how this low-level fix would translate to using a template
 filter (e.g. in form inputs)? Nor do I understand your code well enough to
 understand how this fix broke it. If you had a test or even a snippet to
 demonstrate the change in behavior, that would be helpful.

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d63ac3ca5635bb924b86496ae6e2a32f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2015-01-14 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  closed
Component:  Utilities   |  Version:  1.8alpha1
 Severity:  Release blocker |   Resolution:  fixed
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by collinanderson):

 On 1.7 the template renders the string "$27.98", but on 1.8 its "27.98".

 My Money() subclass overrides __str__/__unicode__.

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.b490eeb179b5adbca913868bea1f2a7a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2015-01-14 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  closed
Component:  Utilities   |  Version:  1.8alpha1
 Severity:  Release blocker |   Resolution:  fixed
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by collinanderson):

 * severity:  Normal => Release blocker
 * cc: cmawebsite@… (added)
 * version:  1.7 => 1.8alpha1
 * easy:  1 => 0
 * has_patch:  1 => 0
 * stage:  Ready for checkin => Unreviewed


Comment:

 I'm using a custom "Money" subclass of DecimalField that automatically
 adds a dollar sign when displaying. It works fine on 1.7 but now it
 doesn't work.

 Is it too late possibly change this? We could move this to a {{
 value|decimalformat }} filter, or we could do {{ |stringformat:"F" }}

 If the ship has already sailed, that's ok too. I can always find a
 different way to do it.

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5c7c4e6b2828b0b5d5104ee6a03491e6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-12-03 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
-+-
 Reporter:  xblitz   |Owner:  xblitz
 Type:  Bug  |   Status:  closed
Component:  Utilities|  Version:  1.7
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  DecimalField admin   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"9d1a69579b996eaa208f141b409141be63f597ec"]:
 {{{
 #!CommitTicketReference repository=""
 revision="9d1a69579b996eaa208f141b409141be63f597ec"
 Fixed #23935 -- Converted decimals to fixed point in
 utils.numberformat.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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.55c25fbd979c09b098fd1b1b290b4756%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-12-03 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
-+-
 Reporter:  xblitz   |Owner:  xblitz
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  DecimalField admin   | Triage Stage:  Ready for
Has patch:  1|  checkin
  Needs tests:  0|  Needs documentation:  0
Easy pickings:  1|  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by timgraham):

 * component:  contrib.admin => Utilities
 * stage:  Unreviewed => Ready for checkin


--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.cd10bbf796cb9d3bafb99800226a4751%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-12-02 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  assigned
Component:  contrib.admin   |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Description changed by xblitz:

Old description:

> In the django admin, if a DecimalField's value is lower than 0.01
> displays as Scientific Notation (ex: 1E-7) since python Decimals converts
> automatically to a scientific notation (exponential)  ex:
> Decimal("0.001") = Decimal('1E-7')
>
> this is mostly visible when using Postgresql since DecimalFields with a
> value of 0 are saved with the decimal precision higher than 6 , ex:
> 0. then in the admin instead of seeing 0 or 0. it is
> displayed as 0E-8
>
> the bug can be fixed by converting the Decimal to a fixed point value in
> admin/utils.py:
>

> {{{
> @@ -375,7 +375,7 @@ def display_for_field(value, field):
>  elif isinstance(field, (models.DateField, models.TimeField)):
>  return formats.localize(value)
>  elif isinstance(field, models.DecimalField):
> -return formats.number_format(value, field.decimal_places)
> +return formats.number_format(format(value, "f"),
> field.decimal_places)
>  elif isinstance(field, models.FloatField):
>  return formats.number_format(value)
>  else:
> }}}
>
> link to my branch: https://github.com/xblitz/django/tree/ticket_23935

New description:

 In the django admin, if a DecimalField's value is lower than 0.01
 displays as Scientific Notation (ex: 1E-7) since python Decimals converts
 automatically to a scientific notation (exponential)  ex:
 Decimal("0.001") = Decimal('1E-7')

 this is mostly visible when using Postgresql since DecimalFields with a
 value of 0 are saved with the decimal precision higher than 6 , ex:
 0. then in the admin instead of seeing 0 or 0. it is
 displayed as 0E-8

 the bug can be fixed by converting the Decimal to a fixed point value in
 django.utils.numberformat.format:

 link to my branch: https://github.com/xblitz/django/tree/ticket_23935

--

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.bda74dc9ac6810bfa63f0c91fc2719ae%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-12-01 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  xblitz
 Type:  Bug |   Status:  assigned
Component:  contrib.admin   |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by xblitz):

 * status:  new => assigned
 * owner:  nobody => xblitz


--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.fbb91df39f267edb7db03ea7719f9483%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-11-30 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Description changed by xblitz:

Old description:

> In the django admin, if a DecimalField's value is lower than 0.01
> displays as Scientific Notation (ex: 1E-7) since python Decimals converts
> automatically to a scientific notation (exponential)  ex:
> Decimal("0.001") = Decimal('1E-7')
>
> this is mostly visible when using Postgresql since DecimalFields with a
> value of 0 are saved with the decimal precision higher than 6 , ex:
> 0. then in the admin instead of seeing 0 or 0. it is
> displayed as 0E-8
>
> the bug can be fixed by converting the Decimal to a fixed point value in
> admin/utils.py:
>

> {{{
> @@ -375,7 +375,7 @@ def display_for_field(value, field):
>  elif isinstance(field, (models.DateField, models.TimeField)):
>  return formats.localize(value)
>  elif isinstance(field, models.DecimalField):
> -return formats.number_format(value, field.decimal_places)
> +return formats.number_format(format(value, "f"),
> field.decimal_places)
>  elif isinstance(field, models.FloatField):
>  return formats.number_format(value)
>  else:
> }}}

New description:

 In the django admin, if a DecimalField's value is lower than 0.01
 displays as Scientific Notation (ex: 1E-7) since python Decimals converts
 automatically to a scientific notation (exponential)  ex:
 Decimal("0.001") = Decimal('1E-7')

 this is mostly visible when using Postgresql since DecimalFields with a
 value of 0 are saved with the decimal precision higher than 6 , ex:
 0. then in the admin instead of seeing 0 or 0. it is
 displayed as 0E-8

 the bug can be fixed by converting the Decimal to a fixed point value in
 admin/utils.py:


 {{{
 @@ -375,7 +375,7 @@ def display_for_field(value, field):
  elif isinstance(field, (models.DateField, models.TimeField)):
  return formats.localize(value)
  elif isinstance(field, models.DecimalField):
 -return formats.number_format(value, field.decimal_places)
 +return formats.number_format(format(value, "f"),
 field.decimal_places)
  elif isinstance(field, models.FloatField):
  return formats.number_format(value)
  else:
 }}}

 link to my branch: https://github.com/xblitz/django/tree/ticket_23935

--

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.c8c2172e456ea4f8d4c0b18cc9236130%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23935: DecimalField in admin can show up as Scientific Notation

2014-11-30 Thread Django
#23935: DecimalField in admin can show up as Scientific Notation
+--
 Reporter:  xblitz  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  contrib.admin   |  Version:  1.7
 Severity:  Normal  |   Resolution:
 Keywords:  DecimalField admin  | Triage Stage:  Unreviewed
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+--
Changes (by xblitz):

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


Old description:

> In the django admin, if a DecimalField's value is lower than 0.01
> displays as Scientific Notation (ex: 1E-7) since python Decimals converts
> automatically to a scientific notation (exponential)  ex:
> Decimal("0.001") = Decimal('1E-7')
>
> this is mostly visible when using Postgresql since DecimalFields with a
> value of 0 are saved with the decimal precision higher than 6 , ex:
> 0. then in the admin instead of seeing 0 or 0. it is
> displayed as 0E-8
>
> the bug can be fixed by converting the Decimal to a fixed point value in
> admin/utils.py:
>
> @@ -375,7 +375,7 @@ def display_for_field(value, field):
>  elif isinstance(field, (models.DateField, models.TimeField)):
>  return formats.localize(value)
>  elif isinstance(field, models.DecimalField):
> -return formats.number_format(value, field.decimal_places)
> +return formats.number_format(format(value, "f"),
> field.decimal_places)
>  elif isinstance(field, models.FloatField):
>  return formats.number_format(value)
>  else:

New description:

 In the django admin, if a DecimalField's value is lower than 0.01
 displays as Scientific Notation (ex: 1E-7) since python Decimals converts
 automatically to a scientific notation (exponential)  ex:
 Decimal("0.001") = Decimal('1E-7')

 this is mostly visible when using Postgresql since DecimalFields with a
 value of 0 are saved with the decimal precision higher than 6 , ex:
 0. then in the admin instead of seeing 0 or 0. it is
 displayed as 0E-8

 the bug can be fixed by converting the Decimal to a fixed point value in
 admin/utils.py:


 {{{
 @@ -375,7 +375,7 @@ def display_for_field(value, field):
  elif isinstance(field, (models.DateField, models.TimeField)):
  return formats.localize(value)
  elif isinstance(field, models.DecimalField):
 -return formats.number_format(value, field.decimal_places)
 +return formats.number_format(format(value, "f"),
 field.decimal_places)
  elif isinstance(field, models.FloatField):
  return formats.number_format(value)
  else:
 }}}

--

--
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.91cd2adeeabd703a7e9cb98c4b2d4ec5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.