Created superuser and set up admin panels

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