Exemple #1
0
def post_list(request, page=0, paginate_by=20, **kwargs):

    page_size = Settings.get_current().page_size

    return list_detail.object_list(
        request,
        queryset = Post.objects.published(),
        paginate_by = page_size,
        page = page,
        **kwargs
    )
def blog_settings(request):
    """
    Adds settings information to the context.

    To employ, add the blog_settings method reference to your project
    settings TEMPLATE_CONTEXT_PROCESSORS.

    Example:
        TEMPLATE_CONTEXT_PROCESSORS = (
            ...
            "blog.context_processors.blog_settings",
        )
    """

    blog_settings = Settings.get_current()

    return {
        'BLOG_SETTINGS': blog_settings,
    }