Commit 3ce18251 authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

added filters, serach fields, and list dislpay

parent 2b463ff2
......@@ -5,9 +5,15 @@ from.models import Author, Books
class AuthorAdmin(admin.ModelAdmin):
model = Author
list_display = ("first_name", "last_name", "age", "nationality", "bio",)
search_fields = ("last_name", "nationality",)
list_filter = ("last_name", "nationality")
class BooksAdmin(admin.ModelAdmin):
model = Books
list_display = ("title", "author", "publisher", "year_published", "ISBN", "blurb",)
search_fields = ("title", "author", "publisher", "year_published", "ISBN",)
list_filter = ("title", "author", "publisher", "year_published")
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