def user_blog_index(request, username, template_name="blog/user_blog.html"):
    blogs = Post.objects.filter(status=2).select_related().order_by("-publish")
    if username is not None:
        user = get_object_or_404(User, username=username.lower())
        blogs = blogs.filter(author=user)
    return render_to_response(template_name, {
        "blogs": blogs,
        "username": username,
    }, context_instance=RequestContext(request))
dataset/ETHPy150Open amarandon/smeuhsocial/apps/smeuhoverride/views.py/user_blog_index/original