]> git.p6c8.net - pcdenotes.git/blob - notes/views.py
Changed the way the .env file is loaded
[pcdenotes.git] / notes / views.py
1 from django.shortcuts import render, get_object_or_404
2 from .models import Note
3
4 # Create your views here.
5
6 def note_list(request):
7 notes = Note.objects.filter(status=1)
8 notes_count = Note.objects.filter(status=1).count()
9 return render(request, 'note_list.html', {'notes': notes, 'notes_count': notes_count})
10
11 def note_detail(request, note_slug):
12 note = get_object_or_404(Note, slug=note_slug, status=1)
13 return render(request, 'note_detail.html', {'note': note})

patrick-canterino.de