Hello,
I have a problem with localization and Select() Box, I have the values:
2.00
2.40
3.20
4.00
in my Database, but in Germany we use the number format:
2,00
2,40
3,20
4,00
Now I tried to Localize my modelform with:
class LocalizedModelForm(django.forms.ModelForm):
def __new__(cls, *args, **kwargs):
new_class = super(LocalizedModelForm, cls).__new__(cls)
for field in new_class.base_fields.values():
if isinstance(field, django.forms.DecimalField):
field.localize = True
field.widget.is_localized = True
if isinstance(field, django.forms.Select):
field.localize = True
field.widget.is_localized = True
return new_class
or even an __init__ with the following:
self.fields['endintensity'].localize = True
self.fields['endintensity'].widget.is_localized = True
But i still don't get the localized numbers?
How could i do this correctly??
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.