Commit 99ba4695 authored by Izaac Daniel B. Muncal's avatar Izaac Daniel B. Muncal
parents 2d8f31de c6288ec5
...@@ -19,4 +19,4 @@ class Books(models.Model): ...@@ -19,4 +19,4 @@ class Books(models.Model):
blurb = models.TextField(max_length=200) blurb = models.TextField(max_length=200)
def __str__(self): def __str__(self):
return "{}".format(self.title) return "{}".format(self.title)
\ No newline at end of file
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
\ No newline at end of file
<!DOCTYPE html> {% extends 'base.html' %}
<html lang="en"> {% load static %}
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body> {% block title %}{% endblock %}
</html> {% block header %} header {% endblock %}
\ No newline at end of file {% block body %} body {% endblock %}
\ No newline at end of file
from django.shortcuts import render from django.http import render
from django.views import View from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from .models import Books, Author
def home_view(request): def home_view(request):
return render(request, 'bookshelf/home.html', {}) return render(request, 'bookshelf/home.html', {})
class HomeView(View): class BooksView(ListView):
def get(self,request): model = Books
return render(request, 'bookshelf/home.html', {})
class BooksView(View): class BooksDetailView(DetailView):
def get(self,request): model = Books
return render(request, 'bookshelf/books.html', {})
class BooksDetailView(View): class AuthorView(ListView):
def get(self,request): model = Author
return render(request, 'bookshelf/books_detail.html', {})
class AuthorView(View): class AuthorDetailView(DetailView):
def get(self,request): model = Author
return render(request, 'bookshelf/author.html', {}) \ No newline at end of file
class AuthorDetailView(View):
def get(self,request):
return render(request, 'bookshelf/author_details.html', {})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment