Commit 060f9e76 authored by Angelo Alvarez's avatar Angelo Alvarez

Create Dashboard

parent 5cf1cbff
from django.contrib import admin from django.contrib import admin
# Register your models here. # Register your models here.
from django.contrib import admin
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', 'bio')
list_filter = ('age', 'nationality')
class BooksAdmin(admin.ModelAdmin):
model = Books
list_display = ('title', 'author', 'publisher', 'year_published', 'ISBN', 'blurb')
search_fields = ('title', 'author', 'publisher', 'ISBN', 'blurb')
list_filter = ('author', 'publisher', 'year_published')
# registering the model and the admin is what tells
# Django that admin pages must be generated for the models specified
admin.site.register(Author, AuthorAdmin)
admin.site.register(Books, BooksAdmin)
\ 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