Add documentation and source
Added documentation, source and extra files.
This commit is contained in:
4
source/orm/library/admin/__init__.py
Normal file
4
source/orm/library/admin/__init__.py
Normal file
@ -0,0 +1,4 @@
|
||||
from .author import AuthorAdmin
|
||||
from .book import BookAdmin
|
||||
from .genre import GenreAdmin
|
||||
from .person import PersonAdmin
|
14
source/orm/library/admin/author.py
Normal file
14
source/orm/library/admin/author.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from library.models import Author
|
||||
|
||||
|
||||
@admin.register(Author)
|
||||
class AuthorAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
Admin for book authors.
|
||||
|
||||
"""
|
||||
|
||||
list_display = ["id", "uuid", "first_name", "last_name"]
|
||||
list_per_page = 25
|
16
source/orm/library/admin/book.py
Normal file
16
source/orm/library/admin/book.py
Normal file
@ -0,0 +1,16 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from library.models import Book
|
||||
|
||||
|
||||
@admin.register(Book)
|
||||
class BookAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
Admin for books.
|
||||
|
||||
"""
|
||||
|
||||
list_display = ["id", "name", "isbn", "genre", "year"]
|
||||
list_editable = ["year", "genre"]
|
||||
list_filter = ["genre"]
|
||||
list_per_page = 25
|
14
source/orm/library/admin/genre.py
Normal file
14
source/orm/library/admin/genre.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from library.models import Genre
|
||||
|
||||
|
||||
@admin.register(Genre)
|
||||
class GenreAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
Admin for book genres.
|
||||
|
||||
"""
|
||||
|
||||
list_display = ["id", "uuid", "code_name", "name"]
|
||||
list_per_page = 25
|
14
source/orm/library/admin/person.py
Normal file
14
source/orm/library/admin/person.py
Normal file
@ -0,0 +1,14 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from library.models import Person
|
||||
|
||||
|
||||
@admin.register(Person)
|
||||
class PersonAdmin(admin.ModelAdmin):
|
||||
"""
|
||||
Admin for people.
|
||||
|
||||
"""
|
||||
|
||||
list_display = ["id", "uuid", "user", "role", "first_name", "last_name"]
|
||||
list_per_page = 25
|
Reference in New Issue
Block a user