Example #1
0
def show_link(request, link_id):
    """
	"""
    link = get_object_or_404(Link, id=atoi(link_id))
    if link.is_visible == False:
        raise Http404

    comments = link.comments.filter(is_visible=True).all().prefetch_related("user__userprofile__avatar")

    comments = comment_sort(comments, COMMENT_DEEPS)

    return render_to_response(
        "link/show_link.html", {"link": link, "comments": comments}, context_instance=RequestContext(request)
    )
Example #2
0
def show_link(request, link_id):
    '''
	'''
    link = get_object_or_404(Link, id=atoi(link_id))
    if link.is_visible == False:
        raise Http404

    comments = link.comments.filter(
        is_visible=True).all().prefetch_related('user__userprofile__avatar')

    comments = comment_sort(comments, COMMENT_DEEPS)

    return render_to_response('link/show_link.html', {
        'link': link,
        'comments': comments,
    },
                              context_instance=RequestContext(request))
Example #3
0
def show_discuss(request, discuss_id):
    '''
	'''
    discuss = get_object_or_404(Discuss, id=atoi(discuss_id))
    if discuss.is_visible == False:
        raise Http404

    comments = discuss.comments.filter(
        is_visible=True).all().select_related('user__userprofile__avatar')

    comments = comment_sort(comments, COMMENT_DEEPS)

    return render_to_response('discuss/show_discuss.html', {
        'd': discuss,
        'comments': comments
    },
                              context_instance=RequestContext(request))
Example #4
0
def show_discuss(request, discuss_id):
	'''
	'''
	discuss = get_object_or_404(Discuss, id=atoi(discuss_id))
	if discuss.is_visible == False:
		raise Http404
	
	comments = discuss.comments.filter(
	           is_visible=True).all(
	           ).select_related(
	           'user__userprofile__avatar')
	
	comments = comment_sort(comments, COMMENT_DEEPS)
	
	return render_to_response('discuss/show_discuss.html',
	                         {'d': discuss,
	                          'comments': comments},
	                         context_instance=RequestContext(request))