Commit 12c68bca authored by Elaiza Bolislis's avatar Elaiza Bolislis

Made an admin panel for the models in bookshelf app

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