]> git.p6c8.net - pcdenotes.git/blobdiff - notes/views.py
Allow a title of a note used be more than once
[pcdenotes.git] / notes / views.py
index a0a82bc7c68c2673feea3d174b7ae359063dadb3..793f9ed49649edfa89ddb36ee1d8a72d143e73a2 100644 (file)
@@ -17,10 +17,12 @@ def note_list(request):
         page_number = int(request.GET.get('page'))
     except:
         pass
         page_number = int(request.GET.get('page'))
     except:
         pass
+
+    page_count = paginator.num_pages
     
     notes_page = paginator.get_page(page_number)
 
     
     notes_page = paginator.get_page(page_number)
 
-    return render(request, 'note_list.html', {'notes_page': notes_page, 'notes_count': notes_count, 'pages': paginator, 'page_number': page_number})
+    return render(request, 'note_list.html', {'notes_page': notes_page, 'notes_count': notes_count, 'pages': paginator, 'page_number': page_number, 'page_count': page_count})
 
 def note_detail(request, note_slug):
     note = get_object_or_404(Note, slug=note_slug, status=1)
 
 def note_detail(request, note_slug):
     note = get_object_or_404(Note, slug=note_slug, status=1)

patrick-canterino.de