From 9bf6c1872624201435b34c7b492733f882d9b245 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 17 Oct 2014 12:16:56 +0100 Subject: [PATCH] Added get_indexed_objects method to Page --- wagtail/wagtailcore/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wagtail/wagtailcore/models.py b/wagtail/wagtailcore/models.py index a4d0bed92..11e3947fa 100644 --- a/wagtail/wagtailcore/models.py +++ b/wagtail/wagtailcore/models.py @@ -509,6 +509,11 @@ class Page(six.with_metaclass(PageBase, MP_Node, ClusterableModel, index.Indexed if self.url_path.startswith(root_path): return ('' if current_site.id == id else root_url) + reverse('wagtail_serve', args=(self.url_path[len(root_path):],)) + @classmethod + def get_indexed_objects(cls): + content_type = ContentType.objects.get_for_model(cls) + return super(Page, cls).get_indexed_objects().filter(content_type=content_type) + @classmethod def search(cls, query_string, show_unpublished=False, search_title_only=False, extra_filters={}, prefetch_related=[], path=None): # Filters