diff options
Diffstat (limited to 'django/forms/utils.py')
| -rw-r--r-- | django/forms/utils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py index 106074be5c..85297b1a1e 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -14,6 +14,7 @@ import sys # module to maintain backwards compatibility. from django.core.exceptions import ValidationError + def flatatt(attrs): """ Convert a dictionary of attributes to a single string. @@ -37,6 +38,7 @@ def flatatt(attrs): ) return format_html_join('', ' {0}="{1}"', sorted(attrs.items())) + @python_2_unicode_compatible class ErrorDict(dict): """ @@ -59,6 +61,7 @@ class ErrorDict(dict): def as_text(self): return '\n'.join('* %s\n%s' % (k, '\n'.join(' * %s' % force_text(i) for i in v)) for k, v in self.items()) + @python_2_unicode_compatible class ErrorList(list): """ @@ -84,6 +87,7 @@ class ErrorList(list): def __repr__(self): return repr([force_text(e) for e in self]) + # Utilities for time zone support in DateTimeField et al. def from_current_timezone(value): @@ -109,6 +113,7 @@ def from_current_timezone(value): ), sys.exc_info()[2]) return value + def to_current_timezone(value): """ When time zone support is enabled, convert aware datetimes |
