summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/formats.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py
index 0dc23402f2..e176985791 100644
--- a/django/utils/formats.py
+++ b/django/utils/formats.py
@@ -2,11 +2,12 @@ import decimal
import datetime
from django.conf import settings
-from django.utils.translation import get_language, to_locale, check_for_language
+from django.utils import dateformat, numberformat, datetime_safe
from django.utils.importlib import import_module
from django.utils.encoding import smart_str
-from django.utils import dateformat, numberformat, datetime_safe
+from django.utils.functional import lazy
from django.utils.safestring import mark_safe
+from django.utils.translation import get_language, to_locale, check_for_language
# format_cache is a mapping from (format_type, lang) to the format string.
# By using the cache, it is possible to avoid running get_format_modules
@@ -81,6 +82,8 @@ def get_format(format_type, lang=None, use_l10n=None):
_format_cache[cache_key] = None
return getattr(settings, format_type)
+get_format_lazy = lazy(get_format, unicode, list, tuple)
+
def date_format(value, format=None, use_l10n=None):
"""
Formats a datetime.date or datetime.datetime object using a