Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bongudth committed Jun 14, 2022
2 parents fe6dbf2 + 19f1b97 commit 0d2f7f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions books/context_processors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .models import Category

def categories(request):
return {
'categories': Category.objects.all()
}
5 changes: 0 additions & 5 deletions books/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

# Create your views here.

def categories(request):
return {
'categories': Category.objects.all()
}

def all_books(request):
books = Book.objects.all()
return render(request, 'library/home.html', {'books': books})
Expand Down

0 comments on commit 0d2f7f0

Please # to comment.