from django.contrib import admin
from .models import ProjectCategory, Technology, Project

@admin.register(ProjectCategory)
class ProjectCategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')
    prepopulated_fields = {'slug': ('name',)}

@admin.register(Technology)
class TechnologyAdmin(admin.ModelAdmin):
    list_display = ('name', 'icon')
    search_fields = ('name',)

@admin.register(Project)
class ProjectAdmin(admin.ModelAdmin):
    list_display = ('title', 'category', 'client', 'industry', 'completion_date', 'is_featured', 'order')
    list_editable = ('is_featured', 'order')
    list_filter = ('category', 'is_featured', 'industry')
    search_fields = ('title', 'client', 'short_description')
    filter_horizontal = ('technologies',)
    prepopulated_fields = {'slug': ('title',)}
