diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 6 | ||||
| -rw-r--r-- | docs/ref/templates/upgrading.txt | 2 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 17 |
3 files changed, 25 insertions, 0 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index fe392cff97..e9161e7254 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -108,6 +108,12 @@ details on these changes. * The backwards compatibility alias ``django.template.loader.BaseLoader`` will be removed. +* Django template objects returned by + :func:`~django.template.loader.get_template` and + :func:`~django.template.loader.select_template` won't accept a + :class:`~django.template.Context` in their + :meth:`~django.template.backends.base.Template.render()` method anymore. + * The ``current_app`` parameter for the following function and classes will be removed: diff --git a/docs/ref/templates/upgrading.txt b/docs/ref/templates/upgrading.txt index ca336e016d..c7b07464b0 100644 --- a/docs/ref/templates/upgrading.txt +++ b/docs/ref/templates/upgrading.txt @@ -95,6 +95,8 @@ entire :setting:`TEMPLATES` setting instead. :mod:`django.template.loader` ============================= +.. _get_template-upgrade-django-18: + :func:`~django.template.loader.get_template` and :func:`~django.template.loader.select_template` ------------------------------------------------------------------------------------------------ diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 122064971c..4c3b398cd1 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -1380,6 +1380,23 @@ to construct the "view on site" URL. This URL is now accessible using the sure to provide a default value for the ``form_class`` argument since it's now optional. +Rendering templates loaded by :func:`~django.template.loader.get_template()` with a :class:`~django.template.Context` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The return type of :func:`~django.template.loader.get_template()` has changed +in Django 1.8: instead of a :class:`django.template.Template`, it returns a +``Template`` instance whose exact type depends on which backend loaded it. + +Both classes provide a ``render()`` method, however, the former takes a +:class:`django.template.Context` as an argument while the latter expects a +:class:`dict`. This change is enforced through a deprecation path for Django +templates. + +Since it's easier to understand with examples, the :ref:`upgrade guide +<get_template-upgrade-django-18>` shows how to adapt affected code. + +All this also applies to :func:`~django.template.loader.select_template()`. + ``current_app`` argument of template-related APIs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
