from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from .models import Company, Manufacturer

@admin.register(Company)
class CompanyAdmin(SimpleHistoryAdmin):
    list_display = ('id', 'name', 'headquarters', 'website', 'created_at')
    search_fields = ('name', 'headquarters', 'description')
    prepopulated_fields = {'slug': ('name',)}
    readonly_fields = ('created_at', 'updated_at')

@admin.register(Manufacturer)
class ManufacturerAdmin(SimpleHistoryAdmin):
    list_display = ('id', 'name', 'headquarters', 'website', 'created_at')
    search_fields = ('name', 'headquarters', 'description')
    prepopulated_fields = {'slug': ('name',)}
    readonly_fields = ('created_at', 'updated_at')
