* version: 1.1-beta => master
Comment:
The problem here is two folds:
1. By default, admin will not localize input values. Not localized input
is rendered as `str(value)`, which is `Decimal.__str__`. List display uses
`display_for_field`, which localizes value if I18N is on.
2. When forced to localize (by settings `ModelForm._opts.localized_fields
= '__all__'`), decimal input still does not honour
`DecimalField.decimal_places` and is displayed differently from list.
Fix for 2. is easy, overriding `_format_value` in NumberInput to correctly
use `number_format` with `decimal_places`.
Fix for 1. is not easy, if not impossible, tickets #13032 and #13546
mention problems with localizing inputs by default. At least we can better
document current admin behaviour and include instructions to change it.
Better yet, would be to include another `ModelAdmin` option to control
`localized_fields` in generated `ModelForm` classes.
--
Ticket URL: <https://code.djangoproject.com/ticket/11294#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: tomek@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/11294#comment:7>
* status: new => closed
* resolution: => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/11294#comment:8>