def static_page_names(self): from treemap.models import StaticPage # prevent circular import built_in_names = StaticPage.built_in_names() custom_names = [page.name for page in StaticPage.objects.filter(instance=self).exclude(name__in=built_in_names)] names = built_in_names + custom_names return names
def static_page(request, instance, page): static_page = StaticPage.get_or_new(instance, page) return {'content': static_page.content, 'title': static_page.name}