Commit 75d8be12 authored by Joei Yucoco's avatar Joei Yucoco

Populated models and cleaned up code

- removed unnecessary comments
parent 6326bbe6
No preview for this file type
......@@ -27,9 +27,6 @@ class Author(models.Model,URLFunctions):
def get_absolute_detail_url(self):
return reverse('bookshelf:authors-detail', kwargs={'pk':self.pk})
#def get_absolute_list_url(self):
#return reverse('bookshelf:authors-list')
class Books(models.Model,URLFunctions):
title = models.CharField(max_length=100)
......@@ -45,7 +42,3 @@ class Books(models.Model,URLFunctions):
def get_absolute_detail_url(self):
return reverse('bookshelf:books-detail', kwargs={'pk':self.pk})
#def get_absolute_list_url(self):
#return reverse('bookshelf:books-list')
# Create your models here.
......@@ -17,6 +17,7 @@
</li>
{% endfor %}
</ul>
<br>
<h3>
<a href="{{ object.get_absolute_home_url }}" >
......
......@@ -12,6 +12,7 @@
</li>
{% endfor %}
</ul>
<br>
<h3>
<a href="{{ object_list.0.get_absolute_home_url }}" >
......
......@@ -12,6 +12,7 @@
<h3>{{object.year_published}}</h3>
<h3>{{object.ISBN}}</h3>
<h3>{{object.blurb}}</h3>
<br>
<h3>
<a href="{{ object.get_absolute_home_url }}" >
......
......@@ -12,6 +12,7 @@
</li>
{% endfor %}
</ul>
<br>
<h3>
<a href="{{ object_list.0.get_absolute_home_url }}" >
......
......@@ -6,9 +6,6 @@ from django.views.generic.detail import DetailView
from .models import Author, Books
#def index(request):
#return HttpResponse('Hello World!')
def HomeView(request):
return render(request, 'bookshelf/home.html', {
'book': Books,
......@@ -33,11 +30,3 @@ class AuthorDetailsView(DetailView):
model = Author
template_name = 'bookshelf/author_details.html'
#class HomeView(View):
#def get(self, request):
#return render(request, 'bookshelf/home.html', {})
# Create your views here.
......@@ -15,12 +15,8 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import include, path
#from bookshelf.views import HomeView
urlpatterns = [
#path('home/', include('bookshelf.urls', namespace="home")),
#path('home/', HomeView.as_view(), name='home'),
#path('bookshelf/', include('bookshelf.urls', namespace="bookshelf")),
path('', include('bookshelf.urls', namespace="basic")),
path('admin/', admin.site.urls),
]
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