X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/73de75f6bdf2c2deb04f7c94ae62a2684af95759..54612c196135c939a7d17d51b81b1357f6eac9c3:/src/depot/admin.py 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, + ]