quantum-ai-v2/agents/admin.py
Claude 2d670d7b8e 🏠 Create restoration point system with agent freeze
- Add is_locked field to Agent model with migration
- Create stable-working-agents branch and v1.0-working tag
- Export working agents and user data to backups/
- Implement freeze_agents command to lock/unlock agents
- Create restore_working_state command for one-click restoration
- Lock current 3 working agents (Social Ads, Job Posting, PDF Summarizer)
- Add lock status to admin interface

Safe house established! All working agents are now protected.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 09:19:23 +05:30

25 lines
1.0 KiB
Python

from django.contrib import admin
from .models import AgentCategory, Agent, AgentExecution
@admin.register(AgentCategory)
class AgentCategoryAdmin(admin.ModelAdmin):
list_display = ['name', 'slug', 'is_active', 'created_at']
list_filter = ['is_active', 'created_at']
search_fields = ['name', 'description']
prepopulated_fields = {'slug': ('name',)}
@admin.register(Agent)
class AgentAdmin(admin.ModelAdmin):
list_display = ['name', 'category', 'price', 'is_active', 'is_locked', 'created_at']
list_filter = ['category', 'is_active', 'is_locked', 'created_at']
search_fields = ['name', 'description', 'short_description']
prepopulated_fields = {'slug': ('name',)}
readonly_fields = ['created_at', 'updated_at']
@admin.register(AgentExecution)
class AgentExecutionAdmin(admin.ModelAdmin):
list_display = ['agent', 'user', 'status', 'fee_charged', 'created_at']
list_filter = ['status', 'created_at', 'agent__category']
search_fields = ['agent__name', 'user__email']
readonly_fields = ['created_at', 'completed_at']