from django.shortcuts import render


def index(request,):
    pass


def categories(request, ):
    pass


def category(request, category_slug):
    pass


def book(request, category_slug, book_slug):
    pass


def search(request):
    pass

@@ -32,40 +32,178 @@
 nder
-%0A%0A%0Adef index(request,):%0A    pass
+, redirect, get_object_or_404%0Afrom .models import Book, Category, Compass%0A%0A%0Adef index(request,):%0A    return render(request, 'index.html', %7B%22categories%22:  Category.all()%7D)
 %0A%0A%0Ad
@@ -228,105 +228,498 @@
 est,
- 
 ):%0A    
-pass%0A%0A%0Adef category(request, category_slug):%0A    pass%0A%0A%0Adef book(request, category_
+return render(request, 'categories.html', %7B%0A        %22categories%22: Category.all(),%0A    %7D)%0A%0A%0Adef category(request, category_slug):%0A    category = get_object_or_404(Category, slug=category_slug)%0A    return render(request, 'category.html', %7B%0A        %22category%22: category,%0A        %22categories%22: Category.all(),%0A        %22books%22: Compass.find(category=category)%0A    %7D)%0A%0A%0Adef book(request, book_slug):%0A    return render(request, 'book.html', %7B%0A        %22book%22:   get_object_or_404(Book, 
 slug
-, 
+=
 book
@@ -728,47 +728,593 @@
 lug)
-:
+,
 %0A    
-pass%0A%0A%0Adef search(request):%0A    pass
+    %22categories%22: Category.all(),%0A        %7D)%0A%0A%0Adef search(request):%0A    if (request.method == 'GET'):%0A        return redirect('/')%0A%0A    if(request.method == 'POST'):%0A        title = request.POST.get('title')%0A        category = request.POST.get('category')%0A        books = Compass.find(%0A            title=title,%0A            category=category)%0A%0A        return render(%0A            request,%0A            'books.html', %7B%0A                %22books%22: books,%0A                %22title%22: Compass.heading(title=title, category=category),%0A                %22categories%22: Category.all(),%0A             %7D)
 %0A

Implement views