#7741 closed (fixed)
move django.newforms to django.forms
Reported by: | Gary Wilson | Owned by: | Gary Wilson |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Ticket for tracking the backwards-incompatible change before 1.0 of moving the django.newforms
package to django.forms
and making oldforms only importable from django.oldforms
and not django.forms
. Other changes include:
- Updates of all newforms/oldforms imports.
- Moving newforms documentation (
newforms.txt
) toforms.txt
, and moving the oldforms documentation (currently atforms.txt
) tooldforms.txt
. - Updating references to newforms/oldforms in all documentation.
To follow/assist this work, see my bzr branch.
Change History (9)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 4 comment:3 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Something went wrong with the move I think, it is not possible to access submodules of the django.newforms
module with specific imports, such as from django.newforms.widgets import TextInput
. Altough from django.newforms import widgets
works as expected.
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from django.newforms.widgets import TextInput Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named widgets
The correct import of django.forms.widgets
works as expected, and I'd suspect the error to be located in either [source:django/trunk/django/newforms/__init__.py@8005] or [source:django/trunk/django/forms/__init__.py@8005].
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Replying to Mads Sülau Jørgensen <django@mads.sulau.dk>:
Something went wrong with the move I think, it is not possible to access submodules of the
django.newforms
module with specific imports, such asfrom django.newforms.widgets import TextInput
. Altoughfrom django.newforms import widgets
works as expected.
Note the log message immediately above your re-opening states:
"There's a warning upon import of django.newforms itself, but deeper imports will raise errors."
I believe the way it was done was intentional. Just go ahead and migrate from importing newforms to importing forms in your code now, it's going to have to be done eventually.
comment:5 by , 16 years ago
I think breaking existing code should be avoided where possible. The ImportError
can be avoided by doing some __path__
appending, leaving older sites working but running with DeprecationWarning
s which must be the overall goal before removal of the newforms
module.
comment:6 by , 16 years ago
madssj: The newforms docs have always said that the newforms name was temporary, and part of the form framework transition plan. The import format suggested in the docs (from django import newforms as forms) raises the appropriate deprecation warning. The backwards incompatibility docs describe the change that has occurred, and the way to transition your code.
It is unfortunate that other import forms break, but the effort involved in avoiding the breakage you describe simply isn't worth it for a temporary transition aid.
comment:7 by , 16 years ago
Needs documentation: | set |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
The documentation, docs/newforms.txt, has not been updated as part of [7971] or since then source:/django/trunk/docs/newforms.txt#8014. References are still made to newforms in the docs. Reopening this ticket as it initially referenced updating the documentation and I'm unable to find an open ticket for the documentation changes needed.
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I've opened #7864 to keep track of this separately.
(In [7971]) 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.