Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#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) to forms.txt, and moving the oldforms documentation (currently at forms.txt) to oldforms.txt.
  • Updating references to newforms/oldforms in all documentation.

To follow/assist this work, see my bzr branch.

Change History (9)

comment:1 by Simon Greenhill, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Jacob, 16 years ago

Resolution: fixed
Status: newclosed

(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.

comment:3 by Mads Sülau Jørgensen <django@…>, 16 years ago

Resolution: fixed
Status: closedreopened

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].

in reply to:  3 comment:4 by Karen Tracey <kmtracey@…>, 16 years ago

Resolution: fixed
Status: reopenedclosed

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 as from django.newforms.widgets import TextInput. Altough from 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 Mads Sülau Jørgensen, 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 DeprecationWarnings which must be the overall goal before removal of the newforms module.

comment:6 by Russell Keith-Magee, 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 CHasenpflug, 16 years ago

Needs documentation: set
Resolution: fixed
Status: closedreopened

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 Jacob, 16 years ago

Resolution: fixed
Status: reopenedclosed

I've opened #7864 to keep track of this separately.

comment:9 by Jacob, 12 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

Note: See TracTickets for help on using tickets.
Back to Top