Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #4318 -- Fixed unused imports and other various style tweaks in…

… newforms. Thanks, Gary Wilson

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5263 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4868af8a57f9b0e72310a9ca05d23da415f6d29b 1 parent 6f44cff
Adrian Holovaty authored May 16, 2007
3  django/newforms/extras/widgets.py
@@ -2,9 +2,10 @@
2 2
 Extra HTML Widget classes
3 3
 """
4 4
 
  5
+import datetime
  6
+
5 7
 from django.newforms.widgets import Widget, Select
6 8
 from django.utils.dates import MONTHS
7  
-import datetime
8 9
 
9 10
 __all__ = ('SelectDateWidget',)
10 11
 
8  django/newforms/fields.py
@@ -2,13 +2,15 @@
2 2
 Field classes
3 3
 """
4 4
 
  5
+import datetime
  6
+import re
  7
+import time
  8
+
5 9
 from django.utils.translation import gettext
6 10
 from django.utils.encoding import smart_unicode
  11
+
7 12
 from util import ErrorList, ValidationError
8 13
 from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple
9  
-import datetime
10  
-import re
11  
-import time
12 14
 
13 15
 __all__ = (
14 16
     'Field', 'CharField', 'IntegerField',
8  django/newforms/forms.py
@@ -2,13 +2,15 @@
2 2
 Form classes
3 3
 """
4 4
 
5  
-from django.utils.datastructures import SortedDict, MultiValueDict
  5
+import copy
  6
+
  7
+from django.utils.datastructures import SortedDict
6 8
 from django.utils.html import escape
7 9
 from django.utils.encoding import StrAndUnicode
  10
+
8 11
 from fields import Field
9  
-from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput
  12
+from widgets import TextInput, Textarea
10 13
 from util import flatatt, ErrorDict, ErrorList, ValidationError
11  
-import copy
12 14
 
13 15
 __all__ = ('BaseForm', 'Form')
14 16
 
9  django/newforms/models.py
@@ -4,13 +4,16 @@
4 4
 """
5 5
 
6 6
 from django.utils.translation import gettext
  7
+
7 8
 from util import ValidationError
8  
-from forms import BaseForm, DeclarativeFieldsMetaclass, SortedDictFromList
  9
+from forms import BaseForm, SortedDictFromList
9 10
 from fields import Field, ChoiceField
10 11
 from widgets import Select, SelectMultiple, MultipleHiddenInput
11 12
 
12  
-__all__ = ('save_instance', 'form_for_model', 'form_for_instance', 'form_for_fields',
13  
-           'ModelChoiceField', 'ModelMultipleChoiceField')
  13
+__all__ = (
  14
+    'save_instance', 'form_for_model', 'form_for_instance', 'form_for_fields',
  15
+    'ModelChoiceField', 'ModelMultipleChoiceField'
  16
+)
14 17
 
15 18
 def save_instance(form, instance, fields=None, fail_message='saved', commit=True):
16 19
     """
2  django/newforms/util.py
... ...
@@ -1,6 +1,4 @@
1  
-from django.conf import settings
2 1
 from django.utils.html import escape
3  
-from django.utils.functional import Promise, lazy
4 2
 from django.utils.encoding import smart_unicode
5 3
 
6 4
 # Converts a dictionary to a single string with key="value", XML-style with
26  django/newforms/widgets.py
@@ -2,24 +2,26 @@
2 2
 HTML Widget classes
3 3
 """
4 4
 
5  
-__all__ = (
6  
-    'Widget', 'TextInput', 'PasswordInput', 'HiddenInput', 'MultipleHiddenInput',
7  
-    'FileInput', 'Textarea', 'CheckboxInput',
8  
-    'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect', 'CheckboxSelectMultiple',
9  
-    'MultiWidget', 'SplitDateTimeWidget',
10  
-)
  5
+try:
  6
+    set # Only available in Python 2.4+
  7
+except NameError:
  8
+    from sets import Set as set # Python 2.3 fallback
  9
+from itertools import chain
11 10
 
12  
-from util import flatatt
13 11
 from django.utils.datastructures import MultiValueDict
14 12
 from django.utils.html import escape
15 13
 from django.utils.translation import gettext
16 14
 from django.utils.encoding import StrAndUnicode, smart_unicode
17  
-from itertools import chain
18 15
 
19  
-try:
20  
-    set # Only available in Python 2.4+
21  
-except NameError:
22  
-    from sets import Set as set # Python 2.3 fallback
  16
+from util import flatatt
  17
+
  18
+__all__ = (
  19
+    'Widget', 'TextInput', 'PasswordInput',
  20
+    'HiddenInput', 'MultipleHiddenInput',
  21
+    'FileInput', 'Textarea', 'CheckboxInput',
  22
+    'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect',
  23
+    'CheckboxSelectMultiple', 'MultiWidget', 'SplitDateTimeWidget',
  24
+)
23 25
 
24 26
 class Widget(object):
25 27
     is_hidden = False          # Determines whether this corresponds to an <input type="hidden">.

0 notes on commit 4868af8

Please sign in to comment.
Something went wrong with that request. Please try again.