Merge pull request #1423 from kaedroho/staticsitegen-example-fix

Update staticsitegen example to use new RoutablePage syntax
pull/1429/head
Karl Hobley 2015-06-19 11:40:49 +01:00
commit 0ed4e26d63
1 zmienionych plików z 3 dodań i 7 usunięć

Wyświetl plik

@ -58,21 +58,17 @@ Example:
.. code:: python .. code:: python
from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin from wagtail.contrib.wagtailroutablepage.models import RoutablePageMixin, route
class BlogIndex(Page, RoutablePageMixin): class BlogIndex(Page, RoutablePageMixin):
... ...
subpage_urls = ( @route(r'^$', name='main')
url(r'^$', 'serve_page', {'page': 1}), @route(r'^page/(?P<page>\d+)/$', name='page')
url(r'^page/(?P<page>\d+)/$', 'serve_page', name='page'),
)
def serve_page(self, request, page=1): def serve_page(self, request, page=1):
... ...
Then in the template, you can use the ``{% routablepageurl %}`` tag to link between the pages: Then in the template, you can use the ``{% routablepageurl %}`` tag to link between the pages:
.. code:: html+Django .. code:: html+Django