Example #1
0
File: views.py Project: feakuru/web
def index(request, page):
	pager = Question.objects.index()
	context = RequestContext(request, {
		'popular': popular_tags(),
		'questions': findPage(pager, page or 1),
		'pages_total': pager.num_pages,
		'whatami': 'index',
	})
	return render(request, 'index.htm', context)
Example #2
0
File: views.py Project: feakuru/web
def question(request, question_id, page):
	q = get_object_or_404(Question, id=question_id)
	pager = q.get_answers()
	context = RequestContext(request, {
		'question': q,
		'answers': findPage(pager, page or 1),
		'popular': popular_tags(),
		'pages_total': pager.num_pages,
		'whatami': 'question',
	})
	return render(request, 'question.htm', context)