How to use the feincms.module.page.models.Page.objects.best_match_for_path function in FeinCMS

To help you get started, we’ve selected a few FeinCMS examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthiask / django-content-editor / feincms / tests.py View on Github external
def test_19_page_manager(self):
        self.create_default_page_set()

        page = Page.objects.get(pk=2)
        page.active = True
        page.save()

        self.assertEqual(page, Page.objects.page_for_path(page.get_absolute_url()))
        self.assertEqual(page, Page.objects.best_match_for_path(page.get_absolute_url() + 'something/hello/'))

        self.assertRaises(Http404, lambda: Page.objects.best_match_for_path('/blabla/blabla/', raise404=True))
github feincms / feincms / feincms / tests.py View on Github external
        self.assertRaises(Http404, lambda: Page.objects.best_match_for_path('/blabla/blabla/', raise404=True))
github matthiask / django-content-editor / feincms / tests.py View on Github external
        self.assertRaises(Http404, lambda: Page.objects.best_match_for_path('/blabla/blabla/', raise404=True))
github matthiask / django-content-editor / feincms / views / applicationcontent.py View on Github external
def __call__(self, request, path=None):
        return self.build_response(request,
            Page.objects.best_match_for_path(path or request.path, raise404=True))
github feincms / feincms / feincms / infanta / middleware.py View on Github external
def process_view(self, request, func, vargs, vkwargs):
        # do not process functions marked with @infanta_exclude
        if getattr(func, '_infanta_exclude ', False):
            return

        for url in settings.INFANTA_EXCLUDE_URLS:
            if request.path.startswith(url):
                return

        page = Page.objects.best_match_for_path(request.path)

        if not page:
        	return

        '''
        extend the page object, so we have an attribute to access 
        our view contents in the templatetag  as well as in the render method 
        of the content type
        '''
        page.vc_manager = {}

        # run request processors and return short-circuit the response handling
        # if a request processor returned a response.
        response = page.setup_request(request)
        if response:
            return response
github feincms / feincms / feincms / views / legacy / views.py View on Github external
def __call__(self, request, path=None):
        return self.build_response(request,
            Page.objects.best_match_for_path(path or request.path, raise404=True))
github django-leonardo / django-leonardo / hrcms / module / web / widget / pagetitle / models.py View on Github external
def render_content(self, options):
        page = Page.objects.best_match_for_path(
            options['request'].path, raise404=False)

        try:
            fragments = options['request']._feincms_fragments
        except:
            fragments = {}

        if fragments.has_key("_page_title"):
            title = fragments["_page_title"]
        else:
            title = None

        if fragments.has_key("_page_subtitle"):
            subtitle = fragments["_page_subtitle"]
        else:
            subtitle = None
github matthiask / django-content-editor / feincms / views / base.py View on Github external
def __call__(self, request, path=None):
        return self.build_response(request,
            Page.objects.best_match_for_path(path or request.path, raise404=True))