from django.contrib import admin
from .models import mindMap, Node

@admin.register(mindMap)
class mindMapAdmin(admin.ModelAdmin):
    list_display = ['id', 'file_name', 'created_at', 'updated_at', 'deleted']
    list_filter = ['deleted', 'created_at']
    search_fields = ['file_name']
    readonly_fields = ['created_at', 'updated_at']

@admin.register(Node)
class NodeAdmin(admin.ModelAdmin):
    list_display = ['id', 'title', 'mindmap', 'is_root', 'parent_id', 'depth', 'created_at', 'deleted']
    list_filter = ['is_root', 'deleted', 'created_at']
    search_fields = ['title', 'desc', 'parent_id']
    readonly_fields = ['created_at', 'updated_at']
