Django

Code

Ticket #626 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

Move template modules to django.core.template package

Reported by: adrian Assigned to: adrian
Milestone: Component: Core framework
Version: 1.0 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by adrian)

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

626_import_error.patch (64.7 kB) - added by adrian on 10/14/05 12:07:29.
Patch that causes circular-import problem.
626_working.patch (122.9 kB) - added by rjwittams on 10/14/05 13:12:47.
working patch

Change History

10/14/05 10:02:06 changed by adrian

  • status changed from new to assigned.

10/14/05 10:08:21 changed by adrian

  • description changed.

(Changed formatting in description.)

10/14/05 12:07:29 changed by adrian

  • attachment 626_import_error.patch added.

Patch that causes circular-import problem.

10/14/05 12:07:44 changed by adrian

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

10/14/05 13:12:47 changed by rjwittams

  • attachment 626_working.patch added.

working patch

10/14/05 13:13:36 changed by rjwittams

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

10/14/05 13:24:04 changed 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/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 ;-)

10/14/05 13:25:36 changed by adrian

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

10/14/05 15:10:16 changed by adrian

  • status changed from assigned to closed.
  • resolution set to fixed.

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


Add/Change #626 (Move template modules to django.core.template package)




Change Properties
Action