From 4e89105d64bb9e04c409139a41e9c7aac263df4c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 5 Jan 2010 02:39:02 +0000 Subject: [PATCH] Fixed deprecation warning nuisance introduced in r11964. Thanks to Luke Plant for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12097 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/fields.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/django/forms/fields.py b/django/forms/fields.py index a4904d452d..1194196fd1 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -19,6 +19,7 @@ import django.utils.copycompat as copy 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.