(request)
return render(request, template_name="user_votes.html", context=context)
Show posts by user that received votes
Show posts by user that received votes
Show posts by user that received votes
def myvotes(request):
    """
    Show posts by user that received votes
    """
    page = request.GET.get('page', 1)

    votes = Vote.objects.filter(post__author=request.user).select_related('post', 'post__root',
                                                                          'author__profile').order_by("-date")
    # Create the paginator
    paginator = CachedPaginator(object_list=votes,
                                per_page=settings.POSTS_PER_PAGE)

    # Apply the votes paging.
    votes = paginator.get_page(page)

    context = dict(votes=votes, page=page, tab='myvotes')
    return render(request, template_name="user_votes.html", context=context)
def myvotes ( request ) : page = request . GET . get ( 'page' , 1 ) votes = Vote . objects . filter ( post__author = request . user ) . select_related ( 'post' , 'post__root' , 'author__profile' ) . order_by ( "-date" ) # Create the paginator paginator = CachedPaginator ( object_list = votes , per_page = settings . POSTS_PER_PAGE ) # Apply the votes paging. votes = paginator . get_page ( page ) context = dict ( votes = votes , page = page , tab = 'myvotes' ) return render ( request , template_name = "user_votes.html" , context = context )