X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/73de75f6bdf2c2deb04f7c94ae62a2684af95759..042546599575e59a9cb74c91194e3e3af4824447:/src/depot/admin.py?ds=sidebyside diff --git a/src/depot/admin.py b/src/depot/admin.py index eebf0102..3ad1fa30 100644 --- a/src/depot/admin.py +++ b/src/depot/admin.py @@ -1,3 +1,4 @@ +from admin_ordering.admin import OrderableAdmin from django.contrib import admin from . import models @@ -5,3 +6,21 @@ from . import models @admin.register(models.Package) class PackageAdmin(admin.ModelAdmin): raw_id_fields = ['books'] + + +class MediaInsertTextInline(OrderableAdmin, admin.TabularInline): + model = models.MediaInsertText + extra = 0 + + +class PriceLevelInline(OrderableAdmin, admin.TabularInline): + model = models.PriceLevel + extra = 0 + + +@admin.register(models.Shop) +class ShopAdmin(admin.ModelAdmin): + inlines = [ + MediaInsertTextInline, + PriceLevelInline, + ]