diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-15 18:35:02 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-11-16 21:28:26 +0100 |
| commit | 2577ae6a082e8a6abc964f999757e908257eafc1 (patch) | |
| tree | 5909447f0ea74455f9ff8861eb1bc7d6b937d28f /docs | |
| parent | cffa55908271bfbce9069b979ab150cd806c6d59 (diff) | |
Moved all template loaders under django.template.loaders.
Reformatted the code of base.Loader according to modern standards.
Turned the test template loader into a regular locmem.Loader -- but
didn't document it.
Added a normal deprecation path for BaseLoader which is a public API.
Added an accelerated deprecation path for TestTemplateLoader which is
a private API.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 3 | ||||
| -rw-r--r-- | docs/ref/templates/api.txt | 7 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 0bba849713..666ff1f492 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -82,6 +82,9 @@ details on these changes. * The backwards compatibility shim to allow ``FormMixin.get_form()`` to be defined with no default value for its ``form_class`` argument will be removed. +* The backwards compatibility alias ``django.template.loader.BaseLoader`` will + be removed. + .. _deprecation-removed-in-1.9: 1.9 diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 08e001b039..6a3f160af3 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -967,11 +967,16 @@ with the Django loading and rendering system! The next step is to write a ``Loader`` class that returns instances of our custom template class instead of the default :class:`~django.template.Template`. Custom ``Loader`` -classes should inherit from ``django.template.loader.BaseLoader`` and override +classes should inherit from ``django.template.loaders.base.Loader`` and override the ``load_template_source()`` method, which takes a ``template_name`` argument, loads the template from disk (or elsewhere), and returns a tuple: ``(template_string, template_origin)``. +.. versionchanged:: 1.8 + + ``django.template.loaders.base.Loader`` used to be defined at + ``django.template.loader.BaseLoader``. + The ``load_template()`` method of the ``Loader`` class retrieves the template string by calling ``load_template_source()``, instantiates a ``Template`` from the template source, and returns a tuple: ``(template, template_origin)``. Since diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index dc1ced8be6..fb513591a7 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -1029,6 +1029,13 @@ The decorators :func:`~django.test.override_settings` and class decorators. As a consequence, when overriding ``setUpClass()`` or ``tearDownClass()``, the ``super`` implementation should always be called. +``django.template.loader.BaseLoader`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +``django.template.loader.BaseLoader`` was renamed to +``django.template.loaders.base.Loader``. If you've written a custom template +loader that inherits ``BaseLoader``, you must inherit ``Loader`` instead. + .. removed-features-1.8: Features removed in 1.8 |
