Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed deprecation warning nuisance introduced in r11964. Thanks to Lu…

…ke Plant for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12097 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4e89105d64bb9e04c409139a41e9c7aac263df4c 1 parent 7c3387a
@jezdez jezdez authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/forms/fields.py
View
7 django/forms/fields.py
@@ -19,6 +19,7 @@
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode, smart_str
from django.utils.formats import get_format
+from django.utils.functional import lazy
from util import ErrorList, ValidationError
from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateInput, DateTimeInput, TimeInput, SplitDateTimeWidget, SplitHiddenDateTimeWidget
@@ -49,9 +50,9 @@ def en_format(name):
)
return getattr(formats, name)
-DEFAULT_DATE_INPUT_FORMATS = en_format('DATE_INPUT_FORMATS')
-DEFAULT_TIME_INPUT_FORMATS = en_format('TIME_INPUT_FORMATS')
-DEFAULT_DATETIME_INPUT_FORMATS = en_format('DATETIME_INPUT_FORMATS')
+DEFAULT_DATE_INPUT_FORMATS = lazy(lambda: en_format('DATE_INPUT_FORMATS'), tuple, list)()
+DEFAULT_TIME_INPUT_FORMATS = lazy(lambda: en_format('TIME_INPUT_FORMATS'), tuple, list)()
+DEFAULT_DATETIME_INPUT_FORMATS = lazy(lambda: en_format('DATETIME_INPUT_FORMATS'), tuple, list)()
class Field(object):
widget = TextInput # Default widget to use when rendering this type of Field.
Please sign in to comment.
Something went wrong with that request. Please try again.