Hi,

I read the source of the newforms module, but there
seems no easy way to get i18n for dates and decimals.

widget.py:
--------------------------
class Input(Widget):
    def render(self, name, value, attrs=None):
        if value is None: value = ''
        final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
        if value != '': final_attrs['value'] = force_unicode(value) # Only add 
the 'value' attribute if a value is non-empty.
        return u'<input%s />' % flatatt(final_attrs)
-------------------------------------

in render() the decimal object becomes a string.

Maybe the Widget class should have a value2str method, which
cares for this.

The constructor of models.DecimalField could take the
decimal separator as keyword argument and give his Input
Widget this method. Of course the to_python() method
must be changed, too.

Is someone already working on this?
 
 Thomas

-- 
Thomas Güttler, http://www.tbz-pariv.de/ 
Bernsdorfer Str. 210-212, 09126 Chemnitz, Tel.: 0371/5347-917
TBZ-PARIV GmbH  Geschäftsführer: Dr. Reiner Wohlgemuth
Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to