30 lines
652 B
Python
30 lines
652 B
Python
from puzzles.models import Puzzle, PuzzleManufacturer
|
|
from django.contrib import admin
|
|
from scrobbles.admin import ScrobbleInline
|
|
|
|
|
|
class PuzzleInline(admin.TabularInline):
|
|
model = Puzzle
|
|
extra = 0
|
|
|
|
|
|
@admin.register(PuzzleManufacturer)
|
|
class PuzzleManufacturerAdmin(admin.ModelAdmin):
|
|
date_hierarchy = "created"
|
|
search_fields = ("name",)
|
|
|
|
|
|
@admin.register(Puzzle)
|
|
class PuzzleAdmin(admin.ModelAdmin):
|
|
date_hierarchy = "created"
|
|
list_display = (
|
|
"uuid",
|
|
"title",
|
|
)
|
|
raw_id_fields = ("manufacturer",)
|
|
ordering = ("-created",)
|
|
search_fields = ("title",)
|
|
inlines = [
|
|
ScrobbleInline,
|
|
]
|