def revision_detail(request, slug, pk):
    try:
        revision = Revision.objects.filter(page__slug=slug, pk=pk).get()
    except __HOLE__:
        raise Http404, "No revision found matching the query"

    if not revision.page.has_read_permission(request.user):
        if request.user.is_anonymous():
            return HttpResponseRedirect('%s?%s=%s' % (settings.LOGIN_URL, REDIRECT_FIELD_NAME, urlquote(request.get_full_path())))
        else:
            return render_to_response('wiki/permission_denied.html', context_instance=RequestContext(request))

    return render_to_response('wiki/revision_detail.html', {'revision': revision,}, RequestContext(request))
dataset/ETHPy150Open kylef-archive/lithium/lithium/wiki/views.py/revision_detail