Example #1
0
def data_for_all(request):
    """This data is used for all normal pages where no blog is selected."""
    data = common_data(request)
    data.update({"tags": Tag.used_tags(),
                 "archive_qualifier": "",
                 "recent_active_months": Blog.recent_active_months()})
    return data
Example #2
0
def handle_error(request, response, template):
    """Display an error page."""
    response.write(
        loader.render_to_string(
            template,
            None,
            RequestContext(
                request,
                dict = {"blogs": Blog.objects.select_related(),
                        "tags": Tag.used_tags(),
                        "archive_qualifier": "",
                        "recent_active_months": Blog.recent_active_months()}
            )
        )
    )
    return response