1 from admin_ordering.admin import OrderableAdmin
2 from django.contrib import admin
6 @admin.register(models.Package)
7 class PackageAdmin(admin.ModelAdmin):
8 raw_id_fields = ['books']
11 class MediaInsertTextInline(OrderableAdmin, admin.TabularInline):
12 model = models.MediaInsertText
16 class PriceLevelInline(OrderableAdmin, admin.TabularInline):
17 model = models.PriceLevel
21 @admin.register(models.Site)
22 class SiteAdmin(admin.ModelAdmin):
24 MediaInsertTextInline,
28 @admin.register(models.SiteBookPublish)
29 class SiteBookPublishAdmin(admin.ModelAdmin):
30 list_display = ['created_at', 'site_book', 'user', 'status', 'started_at', 'finished_at']
31 list_filter = ['status', 'site_book__site']
32 search_fields = ['book', 'user']
33 date_hierarchy = 'started_at'
34 raw_id_fields = ['site_book']