Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7741: django.newforms is now django.forms. This is obviously a…

… backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 46786b4193e04d398532bbfc3dcf63c03c1793cb 1 parent 39af273
Jacob Kaplan-Moss authored

Showing 60 changed files with 133 additions and 128 deletions. Show diff stats Hide diff stats

  1. 12  django/contrib/admin/options.py
  2. 2  django/contrib/admin/validation.py
  3. 6  django/contrib/admin/widgets.py
  4. 2  django/contrib/auth/forms.py
  5. 2  django/contrib/formtools/tests.py
  6. 2  django/contrib/formtools/wizard.py
  7. 4  django/contrib/localflavor/ar/forms.py
  8. 6  django/contrib/localflavor/au/forms.py
  9. 4  django/contrib/localflavor/br/forms.py
  10. 6  django/contrib/localflavor/ca/forms.py
  11. 4  django/contrib/localflavor/ch/forms.py
  12. 4  django/contrib/localflavor/cl/forms.py
  13. 4  django/contrib/localflavor/de/forms.py
  14. 4  django/contrib/localflavor/es/forms.py
  15. 4  django/contrib/localflavor/fi/forms.py
  16. 4  django/contrib/localflavor/fr/forms.py
  17. 2  django/contrib/localflavor/generic/forms.py
  18. 4  django/contrib/localflavor/in_/forms.py
  19. 6  django/contrib/localflavor/is_/forms.py
  20. 4  django/contrib/localflavor/it/forms.py
  21. 4  django/contrib/localflavor/jp/forms.py
  22. 2  django/contrib/localflavor/mx/forms.py
  23. 4  django/contrib/localflavor/nl/forms.py
  24. 4  django/contrib/localflavor/no/forms.py
  25. 4  django/contrib/localflavor/pe/forms.py
  26. 4  django/contrib/localflavor/pl/forms.py
  27. 2  django/contrib/localflavor/sk/forms.py
  28. 4  django/contrib/localflavor/uk/forms.py
  29. 4  django/contrib/localflavor/us/forms.py
  30. 4  django/contrib/localflavor/za/forms.py
  31. 4  django/db/models/fields/__init__.py
  32. 2  django/db/models/fields/related.py
  33. 18  django/forms/__init__.py
  34. 0  django/{newforms → forms}/extras/__init__.py
  35. 2  django/{newforms → forms}/extras/widgets.py
  36. 0  django/{newforms → forms}/fields.py
  37. 0  django/{newforms → forms}/forms.py
  38. 0  django/{newforms → forms}/formsets.py
  39. 0  django/{newforms → forms}/models.py
  40. 0  django/{newforms → forms}/util.py
  41. 0  django/{newforms → forms}/widgets.py
  42. 25  django/newforms/__init__.py
  43. 2  django/views/generic/create_update.py
  44. 2  tests/modeltests/many_to_one/models.py
  45. 10  tests/modeltests/model_forms/models.py
  46. 4  tests/modeltests/model_formsets/models.py
  47. 4  tests/modeltests/test_client/views.py
  48. 2  tests/regressiontests/forms/error_messages.py
  49. 8  tests/regressiontests/forms/extra.py
  50. 18  tests/regressiontests/forms/fields.py
  51. 2  tests/regressiontests/forms/forms.py
  52. 4  tests/regressiontests/forms/formsets.py
  53. 2  tests/regressiontests/forms/media.py
  54. 2  tests/regressiontests/forms/models.py
  55. 2  tests/regressiontests/forms/regressions.py
  56. 6  tests/regressiontests/forms/util.py
  57. 4  tests/regressiontests/forms/widgets.py
  58. 2  tests/regressiontests/inline_formsets/models.py
  59. 12  tests/regressiontests/modeladmin/models.py
  60. 2  tests/regressiontests/views/views.py
12  django/contrib/admin/options.py
... ...
@@ -1,8 +1,8 @@
1 1
 from django import oldforms, template
2  
-from django import newforms as forms
3  
-from django.newforms.formsets import all_valid
4  
-from django.newforms.models import modelform_factory, inlineformset_factory
5  
-from django.newforms.models import BaseInlineFormset
  2
+from django import forms
  3
+from django.forms.formsets import all_valid
  4
+from django.forms.models import modelform_factory, inlineformset_factory
  5
+from django.forms.models import BaseInlineFormset
6 6
 from django.contrib.contenttypes.models import ContentType
7 7
 from django.contrib.admin import widgets
8 8
 from django.contrib.admin.util import quote, unquote, get_deleted_objects
@@ -775,11 +775,11 @@ def pk_field(self):
775 775
         return AdminField(self.form, self.formset._pk_field_name, False)
776 776
 
777 777
     def deletion_field(self):
778  
-        from django.newforms.formsets import DELETION_FIELD_NAME
  778
+        from django.forms.formsets import DELETION_FIELD_NAME
779 779
         return AdminField(self.form, DELETION_FIELD_NAME, False)
780 780
 
781 781
     def ordering_field(self):
782  
-        from django.newforms.formsets import ORDERING_FIELD_NAME
  782
+        from django.forms.formsets import ORDERING_FIELD_NAME
783 783
         return AdminField(self.form, ORDERING_FIELD_NAME, False)
784 784
 
785 785
 class AdminErrorList(forms.util.ErrorList):
2  django/contrib/admin/validation.py
... ...
@@ -1,7 +1,7 @@
1 1
 
2 2
 from django.core.exceptions import ImproperlyConfigured
3 3
 from django.db import models
4  
-from django.newforms.models import BaseModelForm, BaseModelFormSet, fields_for_model
  4
+from django.forms.models import BaseModelForm, BaseModelFormSet, fields_for_model
5 5
 from django.contrib.admin.options import flatten_fieldsets, BaseModelAdmin
6 6
 from django.contrib.admin.options import HORIZONTAL, VERTICAL
7 7
 
6  django/contrib/admin/widgets.py
@@ -4,9 +4,9 @@
4 4
 
5 5
 import copy
6 6
 
7  
-from django import newforms as forms
8  
-from django.newforms.widgets import RadioFieldRenderer
9  
-from django.newforms.util import flatatt
  7
+from django import forms
  8
+from django.forms.widgets import RadioFieldRenderer
  9
+from django.forms.util import flatatt
10 10
 from django.utils.datastructures import MultiValueDict
11 11
 from django.utils.text import capfirst, truncate_words
12 12
 from django.utils.translation import ugettext as _
2  django/contrib/auth/forms.py
@@ -3,7 +3,7 @@
3 3
 from django.contrib.sites.models import Site
4 4
 from django.template import Context, loader
5 5
 from django.core import validators
6  
-from django import newforms as forms
  6
+from django import forms
7 7
 from django.utils.translation import ugettext_lazy as _
8 8
 
9 9
 class UserCreationForm(forms.ModelForm):
2  django/contrib/formtools/tests.py
... ...
@@ -1,4 +1,4 @@
1  
-from django import newforms as forms
  1
+from django import forms
2 2
 from django.contrib.formtools import preview
3 3
 from django import http
4 4
 from django.conf import settings
2  django/contrib/formtools/wizard.py
@@ -4,7 +4,7 @@
4 4
 stored on the server side.
5 5
 """
6 6
 
7  
-from django import newforms as forms
  7
+from django import forms
8 8
 from django.conf import settings
9 9
 from django.http import Http404
10 10
 from django.shortcuts import render_to_response
4  django/contrib/localflavor/ar/forms.py
@@ -3,8 +3,8 @@
3 3
 AR-specific Form helpers.
4 4
 """
5 5
 
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
8 8
 from django.utils.encoding import smart_unicode
9 9
 from django.utils.translation import ugettext_lazy as _
10 10
 
6  django/contrib/localflavor/au/forms.py
@@ -2,9 +2,9 @@
2 2
 Australian-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
7  
-from django.newforms.util import smart_unicode
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
  7
+from django.forms.util import smart_unicode
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
10 10
 
4  django/contrib/localflavor/br/forms.py
@@ -3,8 +3,8 @@
3 3
 BR-specific Form helpers
4 4
 """
5 5
 
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import Field, RegexField, CharField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import Field, RegexField, CharField, Select, EMPTY_VALUES
8 8
 from django.utils.encoding import smart_unicode
9 9
 from django.utils.translation import ugettext_lazy as _
10 10
 import re
6  django/contrib/localflavor/ca/forms.py
@@ -2,9 +2,9 @@
2 2
 Canada-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
7  
-from django.newforms.util import smart_unicode
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
  7
+from django.forms.util import smart_unicode
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
10 10
 
4  django/contrib/localflavor/ch/forms.py
@@ -2,8 +2,8 @@
2 2
 Swiss-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.encoding import smart_unicode
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
4  django/contrib/localflavor/cl/forms.py
@@ -2,8 +2,8 @@
2 2
 Chile specific form helpers.
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.translation import ugettext_lazy as _
8 8
 from django.utils.encoding import smart_unicode
9 9
 
4  django/contrib/localflavor/de/forms.py
@@ -2,8 +2,8 @@
2 2
 DE-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.translation import ugettext_lazy as _
8 8
 import re
9 9
 
4  django/contrib/localflavor/es/forms.py
@@ -3,8 +3,8 @@
3 3
 Spanish-specific Form helpers
4 4
 """
5 5
 
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import RegexField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import RegexField, Select, EMPTY_VALUES
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
10 10
 
4  django/contrib/localflavor/fi/forms.py
@@ -3,8 +3,8 @@
3 3
 """
4 4
 
5 5
 import re
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 
10 10
 class FIZipCodeField(RegexField):
4  django/contrib/localflavor/fr/forms.py
@@ -2,8 +2,8 @@
2 2
 FR-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.encoding import smart_unicode
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
2  django/contrib/localflavor/generic/forms.py
... ...
@@ -1,4 +1,4 @@
1  
-from django import newforms as forms
  1
+from django import forms
2 2
 
3 3
 DEFAULT_DATE_INPUT_FORMATS = (
4 4
     '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
4  django/contrib/localflavor/in_/forms.py
@@ -2,8 +2,8 @@
2 2
 India-specific Form helpers.
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.encoding import smart_unicode
8 8
 from django.utils.translation import gettext
9 9
 import re
6  django/contrib/localflavor/is_/forms.py
@@ -2,9 +2,9 @@
2 2
 Iceland specific form helpers.
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import RegexField, EMPTY_VALUES
7  
-from django.newforms.widgets import Select
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import RegexField, EMPTY_VALUES
  7
+from django.forms.widgets import Select
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 from django.utils.encoding import smart_unicode
10 10
 
4  django/contrib/localflavor/it/forms.py
@@ -2,8 +2,8 @@
2 2
 IT-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.translation import ugettext_lazy as _
8 8
 from django.utils.encoding import smart_unicode
9 9
 from django.contrib.localflavor.it.util import ssn_check_digit, vat_number_check_digit
4  django/contrib/localflavor/jp/forms.py
@@ -3,9 +3,9 @@
3 3
 """
4 4
 
5 5
 from django.core import validators
6  
-from django.newforms import ValidationError
  6
+from django.forms import ValidationError
7 7
 from django.utils.translation import ugettext_lazy as _
8  
-from django.newforms.fields import RegexField, Select
  8
+from django.forms.fields import RegexField, Select
9 9
 
10 10
 class JPPostalCodeField(RegexField):
11 11
     """
2  django/contrib/localflavor/mx/forms.py
@@ -2,7 +2,7 @@
2 2
 Mexican-specific form helpers.
3 3
 """
4 4
 
5  
-from django.newforms.fields import Select
  5
+from django.forms.fields import Select
6 6
 
7 7
 class MXStateSelect(Select):
8 8
     """
4  django/contrib/localflavor/nl/forms.py
@@ -4,8 +4,8 @@
4 4
 
5 5
 import re
6 6
 
7  
-from django.newforms import ValidationError
8  
-from django.newforms.fields import Field, Select, EMPTY_VALUES
  7
+from django.forms import ValidationError
  8
+from django.forms.fields import Field, Select, EMPTY_VALUES
9 9
 from django.utils.translation import ugettext_lazy as _
10 10
 from django.utils.encoding import smart_unicode
11 11
 
4  django/contrib/localflavor/no/forms.py
@@ -3,8 +3,8 @@
3 3
 """
4 4
 
5 5
 import re, datetime
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 
10 10
 class NOZipCodeField(RegexField):
4  django/contrib/localflavor/pe/forms.py
@@ -3,8 +3,8 @@
3 3
 PE-specific Form helpers.
4 4
 """
5 5
 
6  
-from django.newforms import ValidationError
7  
-from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES
  6
+from django.forms import ValidationError
  7
+from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 
10 10
 class PEDepartmentSelect(Select):
4  django/contrib/localflavor/pl/forms.py
@@ -4,8 +4,8 @@
4 4
 
5 5
 import re
6 6
 
7  
-from django.newforms import ValidationError
8  
-from django.newforms.fields import Select, RegexField
  7
+from django.forms import ValidationError
  8
+from django.forms.fields import Select, RegexField
9 9
 from django.utils.translation import ugettext_lazy as _
10 10
 
11 11
 class PLVoivodeshipSelect(Select):
2  django/contrib/localflavor/sk/forms.py
@@ -2,7 +2,7 @@
2 2
 Slovak-specific form helpers
3 3
 """
4 4
 
5  
-from django.newforms.fields import Select, RegexField
  5
+from django.forms.fields import Select, RegexField
6 6
 from django.utils.translation import ugettext_lazy as _
7 7
 
8 8
 class SKRegionSelect(Select):
4  django/contrib/localflavor/uk/forms.py
@@ -4,8 +4,8 @@
4 4
 
5 5
 import re
6 6
 
7  
-from django.newforms.fields import CharField, Select
8  
-from django.newforms import ValidationError
  7
+from django.forms.fields import CharField, Select
  8
+from django.forms import ValidationError
9 9
 from django.utils.translation import ugettext_lazy as _
10 10
 
11 11
 class UKPostcodeField(CharField):
4  django/contrib/localflavor/us/forms.py
@@ -2,8 +2,8 @@
2 2
 USA-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
7 7
 from django.utils.encoding import smart_unicode
8 8
 from django.utils.translation import ugettext_lazy as _
9 9
 import re
4  django/contrib/localflavor/za/forms.py
@@ -2,8 +2,8 @@
2 2
 South Africa-specific Form helpers
3 3
 """
4 4
 
5  
-from django.newforms import ValidationError
6  
-from django.newforms.fields import Field, RegexField, EMPTY_VALUES
  5
+from django.forms import ValidationError
  6
+from django.forms.fields import Field, RegexField, EMPTY_VALUES
7 7
 from django.utils.checksums import luhn
8 8
 from django.utils.translation import gettext as _
9 9
 import re
4  django/db/models/fields/__init__.py
@@ -14,7 +14,7 @@
14 14
 from django.conf import settings
15 15
 from django.core import validators
16 16
 from django import oldforms
17  
-from django import newforms as forms
  17
+from django import forms
18 18
 from django.core.exceptions import ObjectDoesNotExist
19 19
 from django.utils.datastructures import DictWrapper
20 20
 from django.utils.functional import curry
@@ -411,7 +411,7 @@ def save_form_data(self, instance, data):
411 411
         setattr(instance, self.name, data)
412 412
 
413 413
     def formfield(self, form_class=forms.CharField, **kwargs):
414  
-        "Returns a django.newforms.Field instance for this database Field."
  414
+        "Returns a django.forms.Field instance for this database Field."
415 415
         defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
416 416
         if self.choices:
417 417
             defaults['widget'] = forms.Select(choices=self.get_choices(include_blank=self.blank or not (self.has_default() or 'initial' in kwargs)))
2  django/db/models/fields/related.py
@@ -9,7 +9,7 @@
18  django/forms/__init__.py
... ...
@@ -1 +1,17 @@
1  
-from django.oldforms import *
  1
+"""
  2
+Django validation and HTML form handling.
  3
+
  4
+TODO:
  5
+    Default value for field
  6
+    Field labels
  7
+    Nestable Forms
  8
+    FatalValidationError -- short-circuits all other validators on a form
  9
+    ValidationWarning
  10
+    "This form field requires foo.js" and form.js_includes()
  11
+"""
  12
+
  13
+from util import ValidationError
  14
+from widgets import *
  15
+from fields import *
  16
+from forms import *
  17
+from models import *
0  django/newforms/extras/__init__.py → django/forms/extras/__init__.py
File renamed without changes
2  django/newforms/extras/widgets.py → django/forms/extras/widgets.py
@@ -5,7 +5,7 @@
5 5
 import datetime
6 6
 import re
7 7
 
8  
-from django.newforms.widgets import Widget, Select
  8
+from django.forms.widgets import Widget, Select
9 9
 from django.utils.dates import MONTHS
10 10
 from django.utils.safestring import mark_safe
11 11
 
0  django/newforms/fields.py → django/forms/fields.py
File renamed without changes
0  django/newforms/forms.py → django/forms/forms.py
File renamed without changes
0  django/newforms/formsets.py → django/forms/formsets.py
File renamed without changes
0  django/newforms/models.py → django/forms/models.py
File renamed without changes
0  django/newforms/util.py → django/forms/util.py
File renamed without changes
0  django/newforms/widgets.py → django/forms/widgets.py
File renamed without changes
25  django/newforms/__init__.py
... ...
@@ -1,18 +1,7 @@
1  
-"""
2  
-Django validation and HTML form handling.
3  
-
4  
-TODO:
5  
-    Default value for field
6  
-    Field labels
7  
-    Nestable Forms
8  
-    FatalValidationError -- short-circuits all other validators on a form
9  
-    ValidationWarning
10  
-    "This form field requires foo.js" and form.js_includes()
11  
-"""
12  
-
13  
-from util import ValidationError
14  
-from widgets import *
15  
-from fields import *
16  
-from forms import *
17  
-from models import *
18  
-from formsets import *
  1
+import warnings
  2
+warnings.warn(
  3
+    category = DeprecationWarning,
  4
+    message = "django.newforms is no longer new. Import django.forms instead.",
  5
+    stacklevel = 2
  6
+)
  7
+from django.forms import *
2  django/views/generic/create_update.py
... ...
@@ -1,4 +1,4 @@
1  
-from django.newforms.models import ModelFormMetaclass, ModelForm
  1
+from django.forms.models import ModelFormMetaclass, ModelForm
2 2
 from django.template import RequestContext, loader
3 3
 from django.http import Http404, HttpResponse, HttpResponseRedirect
4 4
 from django.core.xheaders import populate_xheaders
2  tests/modeltests/many_to_one/models.py
@@ -155,7 +155,7 @@ class Meta:
155 155
 [<Article: John's second story>, <Article: This is a test>]
156 156
 
157 157
 # And should work fine with the unicode that comes out of
158  
-# newforms.Form.cleaned_data
  158
+# forms.Form.cleaned_data
159 159
 >>> Article.objects.filter(reporter__first_name__exact='John').extra(where=["many_to_one_reporter.last_name='%s'" % u'Smith'])
160 160
 [<Article: John's second story>, <Article: This is a test>]
161 161
 
10  tests/modeltests/model_forms/models.py
@@ -79,8 +79,8 @@ def __unicode__(self):
79 79
         return self.description
80 80
 
81 81
 __test__ = {'API_TESTS': """
82  
->>> from django import newforms as forms
83  
->>> from django.newforms.models import ModelForm
  82
+>>> from django import forms
  83
+>>> from django.forms.models import ModelForm
84 84
 >>> from django.core.files.uploadedfile import SimpleUploadedFile
85 85
 
86 86
 The bare bones, absolutely nothing custom, basic case.
@@ -113,7 +113,7 @@ def __unicode__(self):
113 113
 ...         model = Category
114 114
 
115 115
 >>> CategoryForm.base_fields['url'].__class__
116  
-<class 'django.newforms.fields.BooleanField'>
  116
+<class 'django.forms.fields.BooleanField'>
117 117
 
118 118
 
119 119
 Using 'fields'.
@@ -211,7 +211,7 @@ def __unicode__(self):
211 211
 
212 212
 # Old form_for_x tests #######################################################
213 213
 
214  
->>> from django.newforms import ModelForm, CharField
  214
+>>> from django.forms import ModelForm, CharField
215 215
 >>> import datetime
216 216
 
217 217
 >>> Category.objects.all()
@@ -605,7 +605,7 @@ def __unicode__(self):
605 605
 
606 606
 # ModelChoiceField ############################################################
607 607
 
608  
->>> from django.newforms import ModelChoiceField, ModelMultipleChoiceField
  608
+>>> from django.forms import ModelChoiceField, ModelMultipleChoiceField
609 609
 
610 610
 >>> f = ModelChoiceField(Category.objects.all())
611 611
 >>> list(f.choices)
4  tests/modeltests/model_formsets/models.py
@@ -26,7 +26,7 @@ def __unicode__(self):
26 26
 
27 27
 >>> from datetime import date
28 28
 
29  
->>> from django.newforms.models import modelformset_factory
  29
+>>> from django.forms.models import modelformset_factory
30 30
 
31 31
 >>> qs = Author.objects.all()
32 32
 >>> AuthorFormSet = modelformset_factory(Author, extra=3)
@@ -227,7 +227,7 @@ def __unicode__(self):
227 227
 We can also create a formset that is tied to a parent model. This is how the
228 228
 admin system's edit inline functionality works.
229 229
 
230  
->>> from django.newforms.models import inlineformset_factory
  230
+>>> from django.forms.models import inlineformset_factory
231 231
 
232 232
 >>> AuthorBooksFormSet = inlineformset_factory(Author, Book, can_delete=False, extra=3)
233 233
 >>> author = Author.objects.get(name='Charles Baudelaire')
4  tests/modeltests/test_client/views.py
@@ -4,8 +4,8 @@
4 4
 from django.template import Context, Template
5 5
 from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
6 6
 from django.contrib.auth.decorators import login_required, permission_required
7  
-from django.newforms.forms import Form
8  
-from django.newforms import fields
  7
+from django.forms.forms import Form
  8
+from django.forms import fields
9 9
 from django.shortcuts import render_to_response
10 10
 
11 11
 def get_view(request):
2  tests/regressiontests/forms/error_messages.py
... ...
@@ -1,6 +1,6 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 tests = r"""
3  
->>> from django.newforms import *
  3
+>>> from django.forms import *
4 4
 >>> from django.core.files.uploadedfile import SimpleUploadedFile
5 5
 
6 6
 # CharField ###################################################################
8  tests/regressiontests/forms/extra.py
... ...
@@ -1,6 +1,6 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 tests = r"""
3  
->>> from django.newforms import *
  3
+>>> from django.forms import *
4 4
 >>> from django.utils.encoding import force_unicode
5 5
 >>> import datetime
6 6
 >>> import time
@@ -14,12 +14,12 @@
14 14
 # Extra stuff #
15 15
 ###############
16 16
 
17  
-The newforms library comes with some extra, higher-level Field and Widget
  17
+The forms library comes with some extra, higher-level Field and Widget
18 18
 classes that demonstrate some of the library's abilities.
19 19
 
20 20
 # SelectDateWidget ############################################################
21 21
 
22  
->>> from django.newforms.extras import SelectDateWidget
  22
+>>> from django.forms.extras import SelectDateWidget
23 23
 >>> w = SelectDateWidget(years=('2007','2008','2009','2010','2011','2012','2013','2014','2015','2016'))
24 24
 >>> print w.render('mydate', '')
25 25
 <select name="mydate_month" id="id_mydate_month">
@@ -424,7 +424,7 @@
424 424
 # Test overriding ErrorList in a form #
425 425
 #######################################
426 426
 
427  
->>> from django.newforms.util import ErrorList
  427
+>>> from django.forms.util import ErrorList
428 428
 >>> class DivErrorList(ErrorList):
429 429
 ...     def __unicode__(self):
430 430
 ...         return self.as_divs()
18  tests/regressiontests/forms/fields.py
... ...
@@ -1,7 +1,7 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 tests = r"""
3  
->>> from django.newforms import *
4  
->>> from django.newforms.widgets import RadioFieldRenderer
  3
+>>> from django.forms import *
  4
+>>> from django.forms.widgets import RadioFieldRenderer
5 5
 >>> from django.core.files.uploadedfile import SimpleUploadedFile
6 6
 >>> import datetime
7 7
 >>> import time
@@ -17,7 +17,7 @@
17 17
 ##########
18 18
 
19 19
 Each Field class does some sort of validation. Each Field has a clean() method,
20  
-which either raises django.newforms.ValidationError or returns the "clean"
  20
+which either raises django.forms.ValidationError or returns the "clean"
21 21
 data -- usually a Unicode object, but, in some rare cases, a list.
22 22
 
23 23
 Each Field's __init__() takes at least these parameters:
@@ -1153,29 +1153,29 @@
1153 1153
 ...         return x
1154 1154
 ...
1155 1155
 >>> import os
1156  
->>> from django import newforms as forms
  1156
+>>> from django import forms
1157 1157
 >>> path = forms.__file__
1158 1158
 >>> path = os.path.dirname(path) + '/'
1159 1159
 >>> fix_os_paths(path)
1160  
-'.../django/newforms/'
  1160
+'.../django/forms/'
1161 1161
 >>> f = forms.FilePathField(path=path)
1162 1162
 >>> f.choices.sort()
1163 1163
 >>> fix_os_paths(f.choices)
1164  
-[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/__init__.pyc', '__init__.pyc'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/fields.pyc', 'fields.pyc'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/forms.pyc', 'forms.pyc'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/models.pyc', 'models.pyc'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/util.pyc', 'util.pyc'), ('.../django/newforms/widgets.py', 'widgets.py'), ('.../django/newforms/widgets.pyc', 'widgets.pyc')]
  1164
+[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/__init__.pyc', '__init__.pyc'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/fields.pyc', 'fields.pyc'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/forms.pyc', 'forms.pyc'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/models.pyc', 'models.pyc'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/util.pyc', 'util.pyc'), ('.../django/forms/widgets.py', 'widgets.py'), ('.../django/forms/widgets.pyc', 'widgets.pyc')]
1165 1165
 >>> f.clean('fields.py')
1166 1166
 Traceback (most recent call last):
1167 1167
 ...
1168 1168
 ValidationError: [u'Select a valid choice. That choice is not one of the available choices.']
1169 1169
 >>> fix_os_paths(f.clean(path + 'fields.py'))
1170  
-u'.../django/newforms/fields.py'
  1170
+u'.../django/forms/fields.py'
1171 1171
 >>> f = forms.FilePathField(path=path, match='^.*?\.py$')
1172 1172
 >>> f.choices.sort()
1173 1173
 >>> fix_os_paths(f.choices)
1174  
-[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')]
  1174
+[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/widgets.py', 'widgets.py')]
1175 1175
 >>> f = forms.FilePathField(path=path, recursive=True, match='^.*?\.py$')
1176 1176
 >>> f.choices.sort()
1177 1177
 >>> fix_os_paths(f.choices)
1178  
-[('.../django/newforms/__init__.py', '__init__.py'), ('.../django/newforms/extras/__init__.py', 'extras/__init__.py'), ('.../django/newforms/extras/widgets.py', 'extras/widgets.py'), ('.../django/newforms/fields.py', 'fields.py'), ('.../django/newforms/forms.py', 'forms.py'), ('.../django/newforms/models.py', 'models.py'), ('.../django/newforms/util.py', 'util.py'), ('.../django/newforms/widgets.py', 'widgets.py')]
  1178
+[('.../django/forms/__init__.py', '__init__.py'), ('.../django/forms/extras/__init__.py', 'extras/__init__.py'), ('.../django/forms/extras/widgets.py', 'extras/widgets.py'), ('.../django/forms/fields.py', 'fields.py'), ('.../django/forms/forms.py', 'forms.py'), ('.../django/forms/models.py', 'models.py'), ('.../django/forms/util.py', 'util.py'), ('.../django/forms/widgets.py', 'widgets.py')]
1179 1179
 
1180 1180
 # SplitDateTimeField ##########################################################
1181 1181
 
2  tests/regressiontests/forms/forms.py
... ...
@@ -1,6 +1,6 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 tests = r"""
3  
->>> from django.newforms import *
  3
+>>> from django.forms import *
4 4
 >>> from django.core.files.uploadedfile import SimpleUploadedFile
5 5
 >>> import datetime
6 6
 >>> import time
4  tests/regressiontests/forms/formsets.py
@@ -5,8 +5,8 @@
5 5
 FormSet allows us to use multiple instance of the same form on 1 page. For now,
6 6
 the best way to create a FormSet is by using the formset_factory function.
7 7
 
8  
->>> from django.newforms import Form, CharField, IntegerField, ValidationError
9  
->>> from django.newforms.formsets import formset_factory, BaseFormSet
  8
+>>> from django.forms import Form, CharField, IntegerField, ValidationError
  9
+>>> from django.forms.formsets import formset_factory, BaseFormSet
10 10
 
11 11
 >>> class Choice(Form):
12 12
 ...     choice = CharField()
2  tests/regressiontests/forms/media.py
@@ -2,7 +2,7 @@
2 2
 # Tests for the media handling on widgets and forms
3 3
 
4 4
 media_tests = r"""
5  
->>> from django.newforms import TextInput, Media, TextInput, CharField, Form, MultiWidget
  5
+>>> from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
6 6
 >>> from django.conf import settings
7 7
 >>> ORIGINAL_MEDIA_URL = settings.MEDIA_URL
8 8
 >>> settings.MEDIA_URL = 'http://media.example.com/media/'
2  tests/regressiontests/forms/models.py
@@ -15,7 +15,7 @@ class ChoiceModel(models.Model):
15 15
     name = models.CharField(max_length=10)
16 16
 
17 17
 __test__ = {'API_TESTS': """
18  
->>> from django.newforms import form_for_model, form_for_instance
  18
+>>> from django.forms import form_for_model, form_for_instance
19 19
 
20 20
 # Boundary conditions on a PostitiveIntegerField #########################
21 21
 >>> BoundaryForm = form_for_model(BoundaryModel)
2  tests/regressiontests/forms/regressions.py
@@ -3,7 +3,7 @@
3 3
 
4 4
 tests = r"""
5 5
 It should be possible to re-use attribute dictionaries (#3810)
6  
->>> from django.newforms import *
  6
+>>> from django.forms import *
7 7
 >>> extra_attrs = {'class': 'special'}
8 8
 >>> class TestForm(Form):
9 9
 ...     f1 = CharField(max_length=10, widget=TextInput(attrs=extra_attrs))
6  tests/regressiontests/forms/util.py
... ...
@@ -1,17 +1,17 @@
1 1
 # coding: utf-8
2 2
 """
3  
-Tests for newforms/util.py module.
  3
+Tests for forms/util.py module.
4 4
 """
5 5
 
6 6
 tests = r"""
7  
->>> from django.newforms.util import *
  7
+>>> from django.forms.util import *
8 8
 >>> from django.utils.translation import ugettext_lazy
9 9
 
10 10
 ###########
11 11
 # flatatt #
12 12
 ###########
13 13
 
14  
->>> from django.newforms.util import flatatt
  14
+>>> from django.forms.util import flatatt
15 15
 >>> flatatt({'id': "header"})
16 16
 u' id="header"'
17 17
 >>> flatatt({'class': "news", 'title': "Read this"})
4  tests/regressiontests/forms/widgets.py
... ...
@@ -1,7 +1,7 @@
1 1
 # -*- coding: utf-8 -*-
2 2
 tests = r"""
3  
->>> from django.newforms import *
4  
->>> from django.newforms.widgets import RadioFieldRenderer
  3
+>>> from django.forms import *
  4
+>>> from django.forms.widgets import RadioFieldRenderer
5 5
 >>> from django.utils.safestring import mark_safe
6 6
 >>> import datetime
7 7
 >>> import time
2  tests/regressiontests/inline_formsets/models.py
@@ -15,7 +15,7 @@ class Child(models.Model):
15 15
 
16 16
 __test__ = {'API_TESTS': """
17 17
 
18  
->>> from django.newforms.models import inlineformset_factory
  18
+>>> from django.forms.models import inlineformset_factory
19 19
 
20 20
 
21 21
 Child has two ForeignKeys to Parent, so if we don't specify which one to use
12  tests/regressiontests/modeladmin/models.py
@@ -119,7 +119,7 @@ class and an AdminSite instance, so let's just go ahead and do that manually
119 119
 If we specify a form, it should use it allowing custom validation to work
120 120
 properly. This won't, however, break any of the admin widgets or media.
121 121
 
122  
->>> from django import newforms as forms
  122
+>>> from django import forms
123 123
 >>> class AdminBandForm(forms.ModelForm):
124 124
 ...     delete = forms.BooleanField()
125 125
 ...     
@@ -174,22 +174,22 @@ class and an AdminSite instance, so let's just go ahead and do that manually
174 174
 >>> cmafa = cma.get_form(request)
175 175
 
176 176
 >>> type(cmafa.base_fields['main_band'].widget.widget)
177  
-<class 'django.newforms.widgets.Select'>
  177
+<class 'django.forms.widgets.Select'>
178 178
 >>> list(cmafa.base_fields['main_band'].widget.choices)
179 179
 [(u'', u'---------'), (1, u'The Doors')]
180 180
 
181 181
 >>> type(cmafa.base_fields['opening_band'].widget.widget)
182  
-<class 'django.newforms.widgets.Select'>
  182
+<class 'django.forms.widgets.Select'>
183 183
 >>> list(cmafa.base_fields['opening_band'].widget.choices)
184 184
 [(u'', u'---------'), (1, u'The Doors')]
185 185
 
186 186
 >>> type(cmafa.base_fields['day'].widget)
187  
-<class 'django.newforms.widgets.Select'>
  187
+<class 'django.forms.widgets.Select'>
188 188
 >>> list(cmafa.base_fields['day'].widget.choices)
189 189
 [('', '---------'), (1, 'Fri'), (2, 'Sat')]
190 190
 
191 191
 >>> type(cmafa.base_fields['transport'].widget)
192  
-<class 'django.newforms.widgets.Select'>
  192
+<class 'django.forms.widgets.Select'>
193 193
 >>> list(cmafa.base_fields['transport'].widget.choices)
194 194
 [('', '---------'), (1, 'Plane'), (2, 'Train'), (3, 'Bus')]
195 195
 
@@ -849,7 +849,7 @@ class and an AdminSite instance, so let's just go ahead and do that manually
849 849
 
850 850
 # formset
851 851
 
852  
->>> from django.newforms.models import BaseModelFormSet
  852
+>>> from django.forms.models import BaseModelFormSet
853 853
 
854 854
 >>> class FakeFormSet(object):
855 855
 ...     pass
2  tests/regressiontests/views/views.py
... ...
@@ -1,5 +1,5 @@
1 1
 from django.http import HttpResponse
2  
-import django.newforms as forms
  2
+from django import forms
3 3
 from django.views.generic.create_update import create_object
4 4
 
5 5
 from models import Article

0 notes on commit 46786b4

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