X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/73de75f6bdf2c2deb04f7c94ae62a2684af95759..2dd4071b8858c9727ee3e2c09b73b1eadef6e31e:/src/depot/admin.py?ds=inline 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, + ]