# views.py (the business logic0)

from django.shortcuts import render;
from models import Book;


def latest_books(request):
    book_list = Book.objects.order_by('-pub_date')[:10];
    return render(request, 'latest_books.html', {'book_list' : book_list});

