from django.contrib import admin
from .models import ContractTemplate, ContractInstance

@admin.register(ContractTemplate)
class ContractTemplateAdmin(admin.ModelAdmin):
    list_display = ['name',]
    search_fields = ['name']
    prepopulated_fields = {'slug': ('name',)}
    readonly_fields = ['created', 'updated']

@admin.register(ContractInstance)
class ContractInstanceAdmin(admin.ModelAdmin):
    list_display = ['process_instance', 'template']
    search_fields = ['process_instance__code', 'template__name']
    readonly_fields = ['created', 'updated']