diff options
| author | Felipe Lee <felipe.lee.garcia@gmail.com> | 2019-10-10 00:22:43 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-30 14:43:52 +0100 |
| commit | c2c27867ef1d4ad32369f8cda42a6d72b262cae5 (patch) | |
| tree | 36b7dec30f45db612dfe97562bc646d2b984c03e /docs/ref/class-based-views | |
| parent | 31d1822532d716d5b2f1422372d07dd05067bfc6 (diff) | |
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.
Diffstat (limited to 'docs/ref/class-based-views')
| -rw-r--r-- | docs/ref/class-based-views/base.txt | 7 |
1 files changed, 2 insertions, 5 deletions
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) |
