Commit 342e707c authored by Deokhyun Lee's avatar Deokhyun Lee

admin panel for the model under bookshelf has been made and completed

parent 2d9eaad6
from django.contrib import admin
from .models import Author, Books
# admin panel for Author model
class AuthorAdmin(admin.ModelAdmin):
model = Author
list_display = ('first_name', 'last_name', 'age', 'nationality','bio')
search_fields = ('first_name', 'last_name', 'age', 'nationality','bio')
list_filter = ('first_name', 'last_name', 'age', 'nationality','bio')
# admin panel for Books model
class BooksAdmin(admin.ModelAdmin):
model = Books
list_display = ('title', 'author', 'publisher', 'year_published', 'ISBN', 'blurb')
search_fields = ('title', 'author', 'publisher', 'year_published', 'ISBN', 'blurb')
list_filter = ('title', 'author', 'publisher', 'year_published', 'ISBN', 'blurb')
admin.site.register(Author, AuthorAdmin)
admin.site.register(Books, BooksAdmin)
# Register your models here.
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