Hard linking of texts to catalogue.
[redakcja.git] / src / depot / admin.py
1 from admin_ordering.admin import OrderableAdmin
2 from django.contrib import admin
3 from . import models
4
5
6 @admin.register(models.Package)
7 class PackageAdmin(admin.ModelAdmin):
8     raw_id_fields = ['books']
9
10
11 class MediaInsertTextInline(OrderableAdmin, admin.TabularInline):
12     model = models.MediaInsertText
13     extra = 0
14
15
16 class PriceLevelInline(OrderableAdmin, admin.TabularInline):
17     model = models.PriceLevel
18     extra = 0
19
20
21 @admin.register(models.Site)
22 class SiteAdmin(admin.ModelAdmin):
23     inlines = [
24         MediaInsertTextInline,
25         PriceLevelInline,
26     ]
27
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']