from django.conf import settings

from django.utils.functional import lazy
from django.utils.safestring import mark_safe

mark_safe_lazy = lazy(mark_safe, str)


def get_image_model():
    return getattr(settings, 'WAGTAILIMAGES_IMAGE_MODEL', 'wagtailimages.Image')

@@ -115,16 +115,81 @@
 k_safe%0A%0A
+from wagtail.wagtailcore.models import PAGE_MODEL_CLASSES, Page%0A%0A
 mark_saf
@@ -324,8 +324,413 @@
 Image')%0A
+%0A%0Adef hide_page_type(cls):%0A    ''''Hide a page type from creation'''%0A    if cls in PAGE_MODEL_CLASSES:%0A        PAGE_MODEL_CLASSES.remove(cls)%0A%0A%0Adef hide_parent_type(cls):%0A    '''%0A    Hide parent page type from creation%0A    '''%0A    for parent in cls.__bases__:%0A        if issubclass(parent, Page):%0A            hide_page_type(parent)%0A            break  # Can only inherit from one page model%0A    return cls%0A

Allow to hide pages