From aad6c20978f497abe36bb8bba4a15fefe0c5bc84 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Mon, 16 Jan 2006 14:55:34 +0000 Subject: [PATCH] magic-removal: changed explicit settings import to qualified settings import in django.forms git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1989 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 8dd9d9f1c7..5e67122a6a 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -1,7 +1,7 @@ from django.core import validators from django.core.exceptions import PermissionDenied from django.utils.html import escape -from django.conf.settings import DEFAULT_CHARSET +from django.conf import settings from django.utils.translation import gettext, gettext_lazy, ngettext FORM_FIELD_ID_PREFIX = 'id_' @@ -374,7 +374,7 @@ class TextField(FormField): self.member_name = member_name def isValidLength(self, data, form): - if data and self.maxlength and len(data.decode(DEFAULT_CHARSET)) > self.maxlength: + if data and self.maxlength and len(data.decode(settings.DEFAULT_CHARSET)) > self.maxlength: raise validators.ValidationError, ngettext("Ensure your text is less than %s character.", "Ensure your text is less than %s characters.", self.maxlength) % self.maxlength @@ -389,7 +389,7 @@ class TextField(FormField): if self.maxlength: maxlength = 'maxlength="%s" ' % self.maxlength if isinstance(data, unicode): - data = data.encode(DEFAULT_CHARSET) + data = data.encode(settings.DEFAULT_CHARSET) return '' % \ (self.input_type, self.get_id(), self.__class__.__name__, self.is_required and ' required' or '', self.field_name, self.length, escape(data), maxlength) @@ -414,7 +414,7 @@ class LargeTextField(TextField): if data is None: data = '' if isinstance(data, unicode): - data = data.encode(DEFAULT_CHARSET) + data = data.encode(settings.DEFAULT_CHARSET) return '' % \ (self.get_id(), self.__class__.__name__, self.is_required and ' required' or '', self.field_name, self.rows, self.cols, escape(data))