X-Git-Url: https://git.p6c8.net/pcdenotes.git/blobdiff_plain/73d81081c6faaa662f442b729648c64d6ef2dc55..a0c0894396d8ff48bbe01df6fc0484ca06179e04:/notes/views.py?ds=sidebyside diff --git a/notes/views.py b/notes/views.py index ef6414f..2c79254 100644 --- a/notes/views.py +++ b/notes/views.py @@ -10,7 +10,7 @@ from .models import Note def note_list(request): notes = Note.objects.all() if request.user.is_staff else Note.objects.filter(status=1) - notes_count = Note.objects.filter(status=1).count() + notes_count = notes.count() paginator = Paginator(notes, NOTES_PER_PAGE) page_number = 1 @@ -42,4 +42,5 @@ def archive_year(request, archive_year): return render(request, 'archive_year.html', {'year': archive_year, 'months': notes_months}) def archive_month(request, archive_year, archive_month): - return render(request, 'archive_month.html', {'year': archive_year, 'month': archive_month}) \ No newline at end of file + notes = Note.objects.filter(status=1, created_at__year=archive_year, created_at__month=archive_month) + return render(request, 'archive_month.html', {'year': archive_year, 'month': archive_month, 'notes': notes}) \ No newline at end of file