Author: gwilson
Date: 2007-10-27 22:38:08 -0500 (Sat, 27 Oct 2007)
New Revision: 6623

Modified:
   django/trunk/django/newforms/fields.py
Log:
Removed duplicate decimal import.


Modified: django/trunk/django/newforms/fields.py
===================================================================
--- django/trunk/django/newforms/fields.py      2007-10-27 16:09:52 UTC (rev 
6622)
+++ django/trunk/django/newforms/fields.py      2007-10-28 03:38:08 UTC (rev 
6623)
@@ -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 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,16 +37,7 @@
 # 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.
     hidden_widget = HiddenInput # Default widget to use when rendering this as 
"hidden".


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to