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