summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorCruiseDevice2020-01-02 16:18:59 +0530
committerCruiseDevice2020-01-02 16:18:59 +0530
commit75e8fb06b42420f21c8571341ef8300a102cd2c7 (patch)
tree37ac9aeae29a06fad73a596580ad9ce0970fcd6c /yaksh/views.py
parenteb05d4b0bc3fd0e2ce5160f30251bd9b939ccef6 (diff)
downloadonline_test-75e8fb06b42420f21c8571341ef8300a102cd2c7.tar.gz
online_test-75e8fb06b42420f21c8571341ef8300a102cd2c7.tar.bz2
online_test-75e8fb06b42420f21c8571341ef8300a102cd2c7.zip
Resolve conflicts
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 7e9b706..d82d4e0 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -1497,7 +1497,16 @@ def show_all_questions(request):
user_tags = questions.values_list('tags', flat=True).distinct()
all_tags = Tag.objects.filter(id__in=user_tags)
upload_form = UploadFileForm()
+ paginator = Paginator(questions, 10)
+ page = request.GET.get('page')
+ try:
+ questions = paginator.page(page)
+ except PageNotAnInteger:
+ questions = paginator.page(1)
+ except EmptyPage:
+ questions = paginator.page(paginator.num_pages)
context['questions'] = questions
+ context['objects'] = questions
context['all_tags'] = all_tags
context['papers'] = []
context['question'] = None