Removed duplicate decimal import.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6623 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1a3bca2b84
commit
6e44f4dee8
|
@ -1,11 +1,20 @@
|
||||||
"""
|
"""
|
||||||
Field classes
|
Field classes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
import re
|
import re
|
||||||
import time
|
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.translation import ugettext
|
||||||
from django.utils.encoding import StrAndUnicode, smart_unicode
|
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 util import ErrorList, ValidationError
|
||||||
from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateTimeInput
|
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__ = (
|
__all__ = (
|
||||||
'Field', 'CharField', 'IntegerField',
|
'Field', 'CharField', 'IntegerField',
|
||||||
'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
|
'DEFAULT_DATE_INPUT_FORMATS', 'DateField',
|
||||||
'DEFAULT_TIME_INPUT_FORMATS', 'TimeField',
|
'DEFAULT_TIME_INPUT_FORMATS', 'TimeField',
|
||||||
'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField',
|
'DEFAULT_DATETIME_INPUT_FORMATS', 'DateTimeField',
|
||||||
'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField', 'BooleanField',
|
'RegexField', 'EmailField', 'FileField', 'ImageField', 'URLField',
|
||||||
'ChoiceField', 'NullBooleanField', 'MultipleChoiceField',
|
'BooleanField', 'NullBooleanField', 'ChoiceField', 'MultipleChoiceField',
|
||||||
'ComboField', 'MultiValueField', 'FloatField', 'DecimalField',
|
'ComboField', 'MultiValueField', 'FloatField', 'DecimalField',
|
||||||
'SplitDateTimeField', 'IPAddressField',
|
'SplitDateTimeField', 'IPAddressField',
|
||||||
)
|
)
|
||||||
|
@ -32,15 +37,6 @@ __all__ = (
|
||||||
# These values, if given to to_python(), will trigger the self.required check.
|
# These values, if given to to_python(), will trigger the self.required check.
|
||||||
EMPTY_VALUES = (None, '')
|
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):
|
class Field(object):
|
||||||
widget = TextInput # Default widget to use when rendering this type of Field.
|
widget = TextInput # Default widget to use when rendering this type of Field.
|
||||||
|
|
Loading…
Reference in New Issue