Commit bbf420db authored by Deokhyun Lee's avatar Deokhyun Lee

View for Authors list is now in order of its id

parent 3536d9d2
Pipeline #2965 canceled with stages
......@@ -9,7 +9,7 @@
{% if authors %}
<ul>
{% for author in authors %}
<a href={{author.id}}/details>{{ author.first_name }} {{ author.last_name}}</a><br>
<a href={{author.id}}/details>{{ author.first_name }} {{ author.last_name}} {{ author.id }}</a><br>
{% endfor %}
</ul>
{% else %}
......
......@@ -3,7 +3,7 @@ from .views import HomeView, AuthorListView, AuthorDetailView, BookListView, Boo
urlpatterns = [
# for Home (landing page)
path('', HomeView.as_view(), name='home'),
path('home/', HomeView.as_view(), name='home'),
# for Authors page
path('authors/', AuthorListView.as_view(), name='authors'),
path('authors/<int:pk>/details', AuthorDetailView.as_view(), name='author-detail'),
......
......@@ -13,7 +13,7 @@ class AuthorListView(ListView):
model = Author
template_name = 'authors/index.html'
context_object_name = 'authors'
ordering = ['first_name']
ordering = ['id']
class AuthorDetailView(DetailView):
model = Author
......
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