created BookInLine

parent 4f636e5b
from django.contrib import admin from django.contrib import admin
from .models import Author, Book from .models import Author, Book
class BookInLine(admin.TabularInline):
model = Book
#admin panel for Author model #admin panel for Author model
class AuthorAdmin(admin.ModelAdmin): class AuthorAdmin(admin.ModelAdmin):
model = Author model = Author
list_display = ("first_name", "last_name", "age", "nationality", "bio",) list_display = ("first_name", "last_name", "age", "nationality", "bio",)
search_fields = ("first_name", "last_name",) search_fields = ("first_name", "last_name",)
inlines = [BookInLine]
#admin panel for Book model #admin panel for Book model
......
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