kopia lustrzana https://github.com/wagtail/wagtail
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
rodzic
c825261bd1
commit
b349ba436e
docs/topics
|
@ -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'
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue