fixed initial index view
authorSven Arnold <sven@internetallee.de>
Mon, 8 Feb 2016 16:08:44 +0000 (17:08 +0100)
committerSven Arnold <sven@internetallee.de>
Mon, 8 Feb 2016 16:08:44 +0000 (17:08 +0100)
project/books/views.py

index a8a020d..aa62cca 100644 (file)
@@ -1,8 +1,11 @@
 from django.shortcuts import render
 from django.http import HttpResponse
 
+from books.models import Book, Lease
+
 def index(request):
-       return HttpResponse("UrteBook")
+       books = ", ".join([str(b) for b in Book.objects.all()])
+       return HttpResponse(books)
 
 def detail(request, book_id):
        response = "Book ID: %s"