mirror of
https://github.com/django/django.git
synced 2025-07-24 21:54:14 +00:00
Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.
Thanks to Marc Garcia for working on this during his Google Summer of Code 2009! Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6632739e94
commit
9233d04265
128 changed files with 2304 additions and 346 deletions
|
@ -10,6 +10,7 @@ from django.utils.html import escape, conditional_escape
|
|||
from django.utils.translation import ugettext
|
||||
from django.utils.encoding import StrAndUnicode, force_unicode
|
||||
from django.utils.safestring import mark_safe
|
||||
from django.utils.formats import localize
|
||||
from django.utils import datetime_safe
|
||||
from datetime import time
|
||||
from util import flatatt
|
||||
|
@ -208,7 +209,7 @@ class Input(Widget):
|
|||
final_attrs = self.build_attrs(attrs, type=self.input_type, name=name)
|
||||
if value != '':
|
||||
# Only add the 'value' attribute if a value is non-empty.
|
||||
final_attrs['value'] = force_unicode(value)
|
||||
final_attrs['value'] = force_unicode(localize(value, is_input=True))
|
||||
return mark_safe(u'<input%s />' % flatatt(final_attrs))
|
||||
|
||||
class TextInput(Input):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue