summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavit Gachechiladze <50764979+gachdavit@users.noreply.github.com>2019-07-18 17:57:25 +0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-18 18:40:40 +0200
commit7f612eda80db1c1c8e502aced54c2062080eae46 (patch)
tree6e39ade52c40e5760e04083fb242afb4adab5b26
parent230d75f59c43b9731465c4ec92ad714e301637b8 (diff)
Fixed #30648 -- Removed unnecessary overriding get_context_data() from mixins with CBVs docs.
-rw-r--r--docs/topics/class-based-views/mixins.txt9
1 files changed, 1 insertions, 8 deletions
diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt
index ac0648df98..ad9fb7547b 100644
--- a/docs/topics/class-based-views/mixins.txt
+++ b/docs/topics/class-based-views/mixins.txt
@@ -461,11 +461,6 @@ Our new ``AuthorDetail`` looks like this::
def get_success_url(self):
return reverse('author-detail', kwargs={'pk': self.object.pk})
- def get_context_data(self, **kwargs):
- context = super().get_context_data(**kwargs)
- context['form'] = self.get_form()
- return context
-
def post(self, request, *args, **kwargs):
if not request.user.is_authenticated:
return HttpResponseForbidden()
@@ -483,9 +478,7 @@ Our new ``AuthorDetail`` looks like this::
``get_success_url()`` is just providing somewhere to redirect to,
which gets used in the default implementation of
-``form_valid()``. We have to provide our own ``post()`` as
-noted earlier, and override ``get_context_data()`` to make the
-:class:`~django.forms.Form` available in the context data.
+``form_valid()``. We have to provide our own ``post()`` as noted earlier.
A better solution
-----------------