from django.contrib import admin

from .models import Asset, AssetFile, AssetTag, AssetTagging, AssetUsage


class AssetFileInline(admin.TabularInline):
    model = AssetFile
    extra = 0


@admin.register(Asset)
class AssetAdmin(admin.ModelAdmin):
    list_display = ("name", "team", "asset_type", "source", "category", "is_deleted", "created_at")
    search_fields = ("name", "team__name")
    list_filter = ("asset_type", "source", "category", "is_deleted")
    inlines = [AssetFileInline]


admin.site.register(AssetTag)
admin.site.register(AssetTagging)
admin.site.register(AssetUsage)

