def article_display(request,article_id): article_id = int(article_id) article = Article.objects.get(id = article_id) if request.GET.has_key("comment_no"): comment_no = int(request.GET["comment_no"]) profile = UserProfile.objects.get_or_create(owner=request.user)[0] else: comment_no = 1 profile = None comments = Comment.objects.filter(article=article) comments, paginations = pa.paginator_query(comments, comment_no, displays=30, half_show_length=5) return render_to_response('article_display.html', {'article': article, 'comments': comments, 'paginations': paginations, 'profile': profile}, context_instance = RequestContext(request))
def article_list(request, block_id): block_id = int(block_id) block = Block.objects.get(id = block_id) if request.GET.has_key('page_no'): page_no = int(request.GET['page_no']) else: page_no = 1 block = Block.objects.get(id = block_id) articles = Article.objects.filter(block = block).order_by('-last_update_timestamp') articles, paginations = pa.paginator_query(articles, page_no) context = {"articles": articles, "b": block, "paginations": paginations} return render_to_response("article_list.html", context, context_instance=RequestContext(request))