diff options
| author | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-28 03:38:08 +0000 |
|---|---|---|
| committer | Gary Wilson Jr <gary.wilson@gmail.com> | 2007-10-28 03:38:08 +0000 |
| commit | 6e44f4dee85021671f72dede9ca4ed4c3bd20dee (patch) | |
| tree | 0e4161e9378d34ef3888671e173d240513c9f883 /django/newforms/fields.py | |
| parent | 1a3bca2b847d97542f61884d09c7fd3fcad8486d (diff) | |
Removed duplicate decimal import.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6623 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/fields.py')
| -rw-r--r-- | django/newforms/fields.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py index 11e6f51779..950307b15f 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -1,11 +1,20 @@ """ -Field classes +Field classes. """ import copy import datetime import re import time +# Python 2.3 fallbacks +try: + from decimal import Decimal, DecimalException +except ImportError: + from django.utils._decimal import Decimal, DecimalException +try: + set +except NameError: + from sets import Set as set from django.utils.translation import ugettext from django.utils.encoding import StrAndUnicode, smart_unicode @@ -13,18 +22,14 @@ from django.utils.encoding import StrAndUnicode, smart_unicode from util import ErrorList, ValidationError from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput -try: - from decimal import Decimal, DecimalException -except ImportError: - from django.utils._decimal import Decimal, DecimalException __all__ = ( 'Field', 'CharField', 'IntegerField', 'DEFAULT_DATE_INPUT_FORMATS', 'DateField', 'DEFAULT_TIME_INPUT_FORMATS', 'TimeField', 'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField', - 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', 'BooleanField', - 'ChoiceField', 'NullBooleanField', 'MultipleChoiceField', + 'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', + 'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField', 'ComboField', 'MultiValueField', 'FloatField', 'DecimalField', 'SplitDateTimeField', 'IPAddressField', ) @@ -32,15 +37,6 @@ __all__ = ( # These values, if given to to_python(), will trigger the self.required check. EMPTY_VALUES = (None, '') -try: - set -except NameError: - from sets import Set as set # Python 2.3 fallback - -try: - from decimal import Decimal -except ImportError: - from django.utils._decimal import Decimal # Python 2.3 fallback class Field(object): widget = TextInput # Default widget to use when rendering this type of Field. |
