diff options
| author | Adam Johnson <me@adamj.eu> | 2019-08-15 06:48:33 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-03-23 08:11:14 +0100 |
| commit | 4ed534758cb6a11df9f49baddecca5a6cdda9311 (patch) | |
| tree | ddfa4db02a7b6db0630352441bc1a92ceaa99a0f /docs | |
| parent | f982f0bdb8317e75af416595c616943d5025da1e (diff) | |
Fixed #19878 -- Deprecated TemplateView passing URL kwargs into context.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 3 | ||||
| -rw-r--r-- | docs/ref/class-based-views/base.txt | 12 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 4 |
3 files changed, 15 insertions, 4 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index a4262af43b..7fea512750 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -66,6 +66,9 @@ details on these changes. * The ``list`` message for ``ModelMultipleChoiceField`` will be removed. +* ``django.views.generic.TemplateView`` will no longer pass URL kwargs directly + to the ``context``. + See the :ref:`Django 3.1 release notes <deprecated-features-3.1>` for more details on these changes. diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt index 7906c56846..de45ae3a5e 100644 --- a/docs/ref/class-based-views/base.txt +++ b/docs/ref/class-based-views/base.txt @@ -117,8 +117,7 @@ MRO is an acronym for Method Resolution Order. .. class:: django.views.generic.base.TemplateView - Renders a given template, with the context containing parameters captured - in the URL. + Renders a given template. **Ancestors (MRO)** @@ -162,12 +161,17 @@ MRO is an acronym for Method Resolution Order. **Context** - * Populated (through :class:`~django.views.generic.base.ContextMixin`) with - the keyword arguments captured from the URL pattern that served the view. + * Populated (through :class:`~django.views.generic.base.ContextMixin`). * You can also add context using the :attr:`~django.views.generic.base.ContextMixin.extra_context` keyword argument for :meth:`~django.views.generic.base.View.as_view`. + .. deprecated:: 3.1 + + Starting in Django 4.0, the keyword arguments captured from the URL + pattern won't be passed to the context. Reference them with + ``view.kwargs`` instead. + ``RedirectView`` ================ diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index 44ba489a44..d9c0a5db11 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -640,6 +640,10 @@ Miscellaneous * The ``list`` message for :class:`~django.forms.ModelMultipleChoiceField` is deprecated in favor of ``invalid_list``. +* The passing of URL kwargs directly to the context by + :class:`~django.views.generic.base.TemplateView` is deprecated. Reference + them in the template with ``view.kwargs`` instead. + .. _removed-features-3.1: Features removed in 3.1 |
