summaryrefslogtreecommitdiff
path: root/django/forms/utils.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 13:12:09 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-02 13:12:09 -0700
commit7548aa8ffd46eb6e0f73730d1b2eb515ba581f95 (patch)
tree963393779f4c8c33351ea605f708f8da7d9f70bf /django/forms/utils.py
parent65c4ac3b2434d1828cb76c9f4454fe64e81354ee (diff)
More attacking E302 violators
Diffstat (limited to 'django/forms/utils.py')
-rw-r--r--django/forms/utils.py5
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