X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c30cd74f1f4dcf0bfbabb0e5a739bcdf236b4946..d3dfd4b8285e3b5939f7865907cc0537e948b6b6:/src/depot/admin.py?ds=inline diff --git a/src/depot/admin.py b/src/depot/admin.py index 35f721bd..3ad1fa30 100644 --- a/src/depot/admin.py +++ b/src/depot/admin.py @@ -1,10 +1,26 @@ +from admin_ordering.admin import OrderableAdmin from django.contrib import admin from . import models @admin.register(models.Package) class PackageAdmin(admin.ModelAdmin): - filter_horizontal = ['books'] - pass - -# Register your models here. + 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, + ]