Opened 15 years ago

Closed 15 years ago

Last modified 14 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 15 years ago.
Patch that causes circular-import problem.
626_working.patch (122.9 KB) - added by rjwittams 15 years ago.
working patch

Download all attachments as: .zip

Change History (9)

comment:1 Changed 15 years ago by Adrian Holovaty

Status: newassigned

comment:2 Changed 15 years ago by Adrian Holovaty

Description: modified (diff)

(Changed formatting in description.)

Changed 15 years ago by Adrian Holovaty

Attachment: 626_import_error.patch added

Patch that causes circular-import problem.

comment:3 Changed 15 years ago by Adrian Holovaty

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

Changed 15 years ago by rjwittams

Attachment: 626_working.patch added

working patch

comment:4 Changed 15 years ago by rjwittams

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

comment:5 Changed 15 years ago by rjwittams

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/ django/core/template/
mkdir django/core/template/loaders/
touch django/core/template/loaders/
svn add django/core/template/loaders/
svn move django/core/ django/core/template/loaders/
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 Changed 15 years ago by Adrian Holovaty

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 Changed 15 years ago by Adrian Holovaty

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