from django.contrib import admin
from .models import UOM, Item, PriceLevel, PriceLevelItem

class ItemAdmin(admin.ModelAdmin):
    list_filter = ("ItemType",)
admin.site.register(UOM)
admin.site.register(Item, ItemAdmin)

class PriceLevelPriceLevelItemInline(admin.TabularInline):
    model = PriceLevelItem
    readonly_fields = ('id',)
    extra = 1

# admin.site.register(PriceLevel)
admin.site.register(PriceLevelItem)

@admin.register(PriceLevel)
class PriceLevelAdmin(admin.ModelAdmin):
    inlines = [PriceLevelPriceLevelItemInline]