Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#626 closed enhancement (fixed)

Move template modules to django.core.template package

Reported by: Adrian Holovaty Owned by: Adrian Holovaty
Component: Core (Other) Version: 1.0
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Adrian Holovaty)

There are too many template-related modules lying around in django.core. We should create a django.core.template package and put the following modules in it:

  • django.core.defaultfilters
  • django.core.defaulttags
  • django.core.template (would be django.core.template.__init__ to retain identical interface)
  • django.core.template_loader
  • django.core.template_file

To maintain backwards compatibility, django.core.template_loader should still exist (at least until 1.0), because a lot of Django code does from django.core.template_loader import ....

We should probably do this before #582 and #625, because those tickets both add template-related modules to django.core.

Attachments (2)

626_import_error.patch (64.7 KB ) - added by Adrian Holovaty 18 years ago.
Patch that causes circular-import problem.
626_working.patch (122.9 KB ) - added by rjwittams 18 years ago.
working patch

Download all attachments as: .zip

Change History (9)

comment:1 by Adrian Holovaty, 18 years ago

Status: newassigned

comment:2 by Adrian Holovaty, 18 years ago

Description: modified (diff)

(Changed formatting in description.)

by Adrian Holovaty, 18 years ago

Attachment: 626_import_error.patch added

Patch that causes circular-import problem.

comment:3 by Adrian Holovaty, 18 years ago

I'm running into circular import problems in the implementation. See the attached patch, 626_import_error.patch. Any ideas?

by rjwittams, 18 years ago

Attachment: 626_working.patch added

working patch

comment:4 by rjwittams, 18 years ago

This patch works and includes some of the changes that were omitted from the previous patch.

comment:5 by rjwittams, 18 years ago

Svn diff utterly sucks. It does not include file moves or directory creations.
So to apply this, do from your trunk checkout:

mkdir django/core/template/
svn add django/core/template/
svn move django/core/template.py django/core/template/__init__.py
mkdir django/core/template/loaders/
touch django/core/template/loaders/__init__.py
svn add django/core/template/loaders/
svn move django/core/template_file.py django/core/template/loaders/filesystem.py
patch -p0 < /path/to/626_working.patch

I think that is it. Untested procedure. Little did I think we would be writing manual patch scripts on the verge of 2006....
bring on bazaar-ng ;-)

comment:6 by Adrian Holovaty, 18 years ago

Got it. Basically you avoided the issue by importing specific objects from django.core.template instead of doing "from django.core import template".

comment:7 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: assignedclosed

(In [867]) Fixed #626 -- Moved template modules to django.core.template package. django.core.template_loader is deprecated, in favor of django.core.template.loader.

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