Forráskód Böngészése

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
8c4c26864103890897ca63708867621f16938a25).

This commit adds those missing parameters.
Andy Chosak 3 éve
szülő
commit
b349ba436e
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      docs/topics/pages.md

+ 3 - 3
docs/topics/pages.md

@@ -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'