How to use the feincms3.apps.page_for_app_request function in feincms3

To help you get started, we’ve selected a few feincms3 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 / feincms3 / tests / testapp / articles_urls.py View on Github external
def article_list_all(request):
    page = page_for_app_request(request)
    page.activate_language(request)
    return render_list(
        request, Article.objects.filter(category=page.application), {"page": page}
    )
github matthiask / feincms3 / tests / testapp / articles_urls.py View on Github external
def article_detail(request, pk):
    page = page_for_app_request(request)
    page.activate_language(request)
    return render_detail(request, get_object_or_404(Article, pk=pk), {"page": page})
github matthiask / feincms3 / tests / testapp / articles_urls.py View on Github external
def article_list(request):
    page = page_for_app_request(request)
    page.activate_language(request)
    return render_list(
        request,
        Article.objects.filter(category=page.application),
        {"page": page},
        paginate_by=5,
    )
github matthiask / feincms3-example / app / articles / views.py View on Github external
def article_detail(request, year, slug):
    page = page_for_app_request(request)
    page.activate_language(request)
    return render_detail(
        request,
        # We are NOT filtering for the current app. If, for example, the
        # blog application is inactive, we'd rather show the article in
        # the publication app than not at all. Of course if this behavior
        # isn't a good fit for you, simply add ``category=page.application``
        # here.
        get_object_or_404(
            Article.objects.published(),
            publication_date__year=year,
            slug=slug,
        ),
        {'page': page},
    )
github matthiask / feincms3-example / app / articles / views.py View on Github external
def article_list(request):
    page = page_for_app_request(request)
    page.activate_language(request)
    return render_list(
        request,
        # Only show articles for the current app.
        Article.objects.published().filter(
            category=page.application,
        ).prefetch_related('images'),
        {'page': page},
        paginate_by=10,
    )