Add missing args/kwargs to Page documentation

Documentation examples of `Page.get_context` and `Page.get_template`
lack `*args` and `**kwargs` parameters (which were added way back in
8c4c268641).

This commit adds those missing parameters.
pull/7462/head
Andy Chosak 2021-08-04 10:41:59 -04:00 zatwierdzone przez Matt Westcott
rodzic c825261bd1
commit b349ba436e
1 zmienionych plików z 3 dodań i 3 usunięć
docs/topics

Wyświetl plik

@ -252,8 +252,8 @@ To add more variables to the template context, you can override this method:
class BlogIndexPage(Page):
...
def get_context(self, request):
context = super().get_context(request)
def get_context(self, request, *args, **kwargs):
context = super().get_context(request, *args, **kwargs)
# Add extra variables and return the updated context
context['blog_entries'] = BlogPage.objects.child_of(self).live()
@ -291,7 +291,7 @@ class BlogPage(Page):
use_other_template = models.BooleanField()
def get_template(self, request):
def get_template(self, request, *args, **kwargs):
if self.use_other_template:
return 'blog/other_blog_page.html'