Permalink
Browse files

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...
1 parent 39af273 commit 46786b4193e04d398532bbfc3dcf63c03c1793cb @jacobian jacobian committed Jul 19, 2008
Showing with 133 additions and 128 deletions.
  1. +6 −6 django/contrib/admin/options.py
  2. +1 −1 django/contrib/admin/validation.py
  3. +3 −3 django/contrib/admin/widgets.py
  4. +1 −1 django/contrib/auth/forms.py
  5. +1 −1 django/contrib/formtools/tests.py
  6. +1 −1 django/contrib/formtools/wizard.py
  7. +2 −2 django/contrib/localflavor/ar/forms.py
  8. +3 −3 django/contrib/localflavor/au/forms.py
  9. +2 −2 django/contrib/localflavor/br/forms.py
  10. +3 −3 django/contrib/localflavor/ca/forms.py
  11. +2 −2 django/contrib/localflavor/ch/forms.py
  12. +2 −2 django/contrib/localflavor/cl/forms.py
  13. +2 −2 django/contrib/localflavor/de/forms.py
  14. +2 −2 django/contrib/localflavor/es/forms.py
  15. +2 −2 django/contrib/localflavor/fi/forms.py
  16. +2 −2 django/contrib/localflavor/fr/forms.py
  17. +1 −1 django/contrib/localflavor/generic/forms.py
  18. +2 −2 django/contrib/localflavor/in_/forms.py
  19. +3 −3 django/contrib/localflavor/is_/forms.py
  20. +2 −2 django/contrib/localflavor/it/forms.py
  21. +2 −2 django/contrib/localflavor/jp/forms.py
  22. +1 −1 django/contrib/localflavor/mx/forms.py
  23. +2 −2 django/contrib/localflavor/nl/forms.py
  24. +2 −2 django/contrib/localflavor/no/forms.py
  25. +2 −2 django/contrib/localflavor/pe/forms.py
  26. +2 −2 django/contrib/localflavor/pl/forms.py
  27. +1 −1 django/contrib/localflavor/sk/forms.py
  28. +2 −2 django/contrib/localflavor/uk/forms.py
  29. +2 −2 django/contrib/localflavor/us/forms.py
  30. +2 −2 django/contrib/localflavor/za/forms.py
  31. +2 −2 django/db/models/fields/__init__.py
  32. +1 −1 django/db/models/fields/related.py
  33. +17 −1 django/forms/__init__.py
  34. 0 django/{newforms → forms}/extras/__init__.py
  35. +1 −1 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. +7 −18 django/newforms/__init__.py
  43. +1 −1 django/views/generic/create_update.py
  44. +1 −1 tests/modeltests/many_to_one/models.py
  45. +5 −5 tests/modeltests/model_forms/models.py
  46. +2 −2 tests/modeltests/model_formsets/models.py
  47. +2 −2 tests/modeltests/test_client/views.py
  48. +1 −1 tests/regressiontests/forms/error_messages.py
  49. +4 −4 tests/regressiontests/forms/extra.py
  50. +9 −9 tests/regressiontests/forms/fields.py
  51. +1 −1 tests/regressiontests/forms/forms.py
  52. +2 −2 tests/regressiontests/forms/formsets.py
  53. +1 −1 tests/regressiontests/forms/media.py
  54. +1 −1 tests/regressiontests/forms/models.py
  55. +1 −1 tests/regressiontests/forms/regressions.py
  56. +3 −3 tests/regressiontests/forms/util.py
  57. +2 −2 tests/regressiontests/forms/widgets.py
  58. +1 −1 tests/regressiontests/inline_formsets/models.py
  59. +6 −6 tests/regressiontests/modeladmin/models.py
  60. +1 −1 tests/regressiontests/views/views.py
@@ -1,8 +1,8 @@
from django import oldforms, template
-from django import newforms as forms
-from django.newforms.formsets import all_valid
-from django.newforms.models import modelform_factory, inlineformset_factory
-from django.newforms.models import BaseInlineFormset
+from django import forms
+from django.forms.formsets import all_valid
+from django.forms.models import modelform_factory, inlineformset_factory
+from django.forms.models import BaseInlineFormset
from django.contrib.contenttypes.models import ContentType
from django.contrib.admin import widgets
from django.contrib.admin.util import quote, unquote, get_deleted_objects
@@ -775,11 +775,11 @@ def pk_field(self):
return AdminField(self.form, self.formset._pk_field_name, False)
def deletion_field(self):
- from django.newforms.formsets import DELETION_FIELD_NAME
+ from django.forms.formsets import DELETION_FIELD_NAME
return AdminField(self.form, DELETION_FIELD_NAME, False)
def ordering_field(self):
- from django.newforms.formsets import ORDERING_FIELD_NAME
+ from django.forms.formsets import ORDERING_FIELD_NAME
return AdminField(self.form, ORDERING_FIELD_NAME, False)
class AdminErrorList(forms.util.ErrorList):
@@ -1,7 +1,7 @@
from django.core.exceptions import ImproperlyConfigured
from django.db import models
-from django.newforms.models import BaseModelForm, BaseModelFormSet, fields_for_model
+from django.forms.models import BaseModelForm, BaseModelFormSet, fields_for_model
from django.contrib.admin.options import flatten_fieldsets, BaseModelAdmin
from django.contrib.admin.options import HORIZONTAL, VERTICAL
@@ -4,9 +4,9 @@
import copy
-from django import newforms as forms
-from django.newforms.widgets import RadioFieldRenderer
-from django.newforms.util import flatatt
+from django import forms
+from django.forms.widgets import RadioFieldRenderer
+from django.forms.util import flatatt
from django.utils.datastructures import MultiValueDict
from django.utils.text import capfirst, truncate_words
from django.utils.translation import ugettext as _
@@ -3,7 +3,7 @@
from django.contrib.sites.models import Site
from django.template import Context, loader
from django.core import validators
-from django import newforms as forms
+from django import forms
from django.utils.translation import ugettext_lazy as _
class UserCreationForm(forms.ModelForm):
@@ -1,4 +1,4 @@
-from django import newforms as forms
+from django import forms
from django.contrib.formtools import preview
from django import http
from django.conf import settings
@@ -4,7 +4,7 @@
stored on the server side.
"""
-from django import newforms as forms
+from django import forms
from django.conf import settings
from django.http import Http404
from django.shortcuts import render_to_response
@@ -3,8 +3,8 @@
AR-specific Form helpers.
"""
-from django.newforms import ValidationError
-from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
@@ -2,9 +2,9 @@
Australian-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
-from django.newforms.util import smart_unicode
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms.util import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -3,8 +3,8 @@
BR-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, CharField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, CharField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -2,9 +2,9 @@
Canada-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
-from django.newforms.util import smart_unicode
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms.util import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -2,8 +2,8 @@
Swiss-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -2,8 +2,8 @@
Chile specific form helpers.
"""
-from django.newforms import ValidationError
-from django.newforms.fields import RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
@@ -2,8 +2,8 @@
DE-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
import re
@@ -3,8 +3,8 @@
Spanish-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
import re
@@ -3,8 +3,8 @@
"""
import re
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
@@ -2,8 +2,8 @@
FR-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -1,4 +1,4 @@
-from django import newforms as forms
+from django import forms
DEFAULT_DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
@@ -2,8 +2,8 @@
India-specific Form helpers.
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import gettext
import re
@@ -2,9 +2,9 @@
Iceland specific form helpers.
"""
-from django.newforms import ValidationError
-from django.newforms.fields import RegexField, EMPTY_VALUES
-from django.newforms.widgets import Select
+from django.forms import ValidationError
+from django.forms.fields import RegexField, EMPTY_VALUES
+from django.forms.widgets import Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
@@ -2,8 +2,8 @@
IT-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.contrib.localflavor.it.util import ssn_check_digit, vat_number_check_digit
@@ -3,9 +3,9 @@
"""
from django.core import validators
-from django.newforms import ValidationError
+from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
-from django.newforms.fields import RegexField, Select
+from django.forms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
@@ -2,7 +2,7 @@
Mexican-specific form helpers.
"""
-from django.newforms.fields import Select
+from django.forms.fields import Select
class MXStateSelect(Select):
"""
@@ -4,8 +4,8 @@
import re
-from django.newforms import ValidationError
-from django.newforms.fields import Field, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
@@ -3,8 +3,8 @@
"""
import re, datetime
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
class NOZipCodeField(RegexField):
@@ -3,8 +3,8 @@
PE-specific Form helpers.
"""
-from django.newforms import ValidationError
-from django.newforms.fields import RegexField, CharField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import RegexField, CharField, Select, EMPTY_VALUES
from django.utils.translation import ugettext_lazy as _
class PEDepartmentSelect(Select):
@@ -4,8 +4,8 @@
import re
-from django.newforms import ValidationError
-from django.newforms.fields import Select, RegexField
+from django.forms import ValidationError
+from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
class PLVoivodeshipSelect(Select):
@@ -2,7 +2,7 @@
Slovak-specific form helpers
"""
-from django.newforms.fields import Select, RegexField
+from django.forms.fields import Select, RegexField
from django.utils.translation import ugettext_lazy as _
class SKRegionSelect(Select):
@@ -4,8 +4,8 @@
import re
-from django.newforms.fields import CharField, Select
-from django.newforms import ValidationError
+from django.forms.fields import CharField, Select
+from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
@@ -2,8 +2,8 @@
USA-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, Select, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, Select, EMPTY_VALUES
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
@@ -2,8 +2,8 @@
South Africa-specific Form helpers
"""
-from django.newforms import ValidationError
-from django.newforms.fields import Field, RegexField, EMPTY_VALUES
+from django.forms import ValidationError
+from django.forms.fields import Field, RegexField, EMPTY_VALUES
from django.utils.checksums import luhn
from django.utils.translation import gettext as _
import re
@@ -14,7 +14,7 @@
from django.conf import settings
from django.core import validators
from django import oldforms
-from django import newforms as forms
+from django import forms
from django.core.exceptions import ObjectDoesNotExist
from django.utils.datastructures import DictWrapper
from django.utils.functional import curry
@@ -411,7 +411,7 @@ def save_form_data(self, instance, data):
setattr(instance, self.name, data)
def formfield(self, form_class=forms.CharField, **kwargs):
- "Returns a django.newforms.Field instance for this database Field."
+ "Returns a django.forms.Field instance for this database Field."
defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
if self.choices:
defaults['widget'] = forms.Select(choices=self.get_choices(include_blank=self.blank or not (self.has_default() or 'initial' in kwargs)))
@@ -9,7 +9,7 @@
from django.utils.encoding import smart_unicode
from django.core import validators
from django import oldforms
-from django import newforms as forms
+from django import forms
from django.dispatch import dispatcher
try:
@@ -1 +1,17 @@
-from django.oldforms import *
+"""
+Django validation and HTML form handling.
+
+TODO:
+ Default value for field
+ Field labels
+ Nestable Forms
+ FatalValidationError -- short-circuits all other validators on a form
+ ValidationWarning
+ "This form field requires foo.js" and form.js_includes()
+"""
+
+from util import ValidationError
+from widgets import *
+from fields import *
+from forms import *
+from models import *
@@ -5,7 +5,7 @@
import datetime
import re
-from django.newforms.widgets import Widget, Select
+from django.forms.widgets import Widget, Select
from django.utils.dates import MONTHS
from django.utils.safestring import mark_safe
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 46786b4

Please sign in to comment.