From c2c27867ef1d4ad32369f8cda42a6d72b262cae5 Mon Sep 17 00:00:00 2001 From: Felipe Lee Date: Thu, 10 Oct 2019 00:22:43 -0500 Subject: Refs #20456 -- Moved initialization of HEAD method based on GET to the View.setup() for generic views. This will ease unit testing of views since setup will essentially do everything needed to set the view instance up (other than instantiating it). Credit for idea goes to Vincent Prouillet. --- docs/ref/class-based-views/base.txt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt index 9645aa7a91..4c1d0e12b5 100644 --- a/docs/ref/class-based-views/base.txt +++ b/docs/ref/class-based-views/base.txt @@ -79,12 +79,9 @@ MRO is an acronym for Method Resolution Order. .. method:: setup(request, *args, **kwargs) - Initializes view instance attributes: ``self.request``, ``self.args``, - and ``self.kwargs`` prior to :meth:`dispatch`. + Performs key view initialization prior to :meth:`dispatch`. - Overriding this method allows mixins to setup instance attributes for - reuse in child classes. When overriding this method, you must call - ``super()``. + If overriding this method, you must call ``super()``. .. method:: dispatch(request, *args, **kwargs) -- cgit v1.3