From 4fde40df9230ea4f2dacefbcda87f931518e3c79 Mon Sep 17 00:00:00 2001 From: Matt Westcott Date: Fri, 4 Jul 2014 18:24:01 +0100 Subject: [PATCH] Update example in static_site_generation docs to use new-style route API --- docs/static_site_generation.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/static_site_generation.rst b/docs/static_site_generation.rst index 9feb59c36..d6b598520 100644 --- a/docs/static_site_generation.rst +++ b/docs/static_site_generation.rst @@ -45,6 +45,8 @@ For example, let's say we have a Blog Index which uses pagination. We can overri .. code:: python + from wagtail.wagtailcore.url_routing import RouteResult + class BlogIndex(Page): ... @@ -54,7 +56,7 @@ For example, let's say we have a Blog Index which uses pagination. We can overri def route(self, request, path_components): if self.live and len(path_components) == 2 and path_components[0] == 'page': try: - return self.serve(request, page=int(path_components[1])) + return RouteResult(self, kwargs={'page': int(path_components[1])}) except (TypeError, ValueError): pass