lot of messs
This commit is contained in:
@@ -4,13 +4,51 @@ Admin configuration for AI models
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
from igny8_core.admin.base import Igny8ModelAdmin
|
||||
from igny8_core.ai.models import AITaskLog
|
||||
from igny8_core.ai.models import AITaskLog, IntegrationState
|
||||
|
||||
|
||||
from import_export.admin import ExportMixin
|
||||
from import_export import resources
|
||||
|
||||
|
||||
@admin.register(IntegrationState)
|
||||
class IntegrationStateAdmin(Igny8ModelAdmin):
|
||||
"""Admin interface for Integration States"""
|
||||
list_display = [
|
||||
'account',
|
||||
'is_openai_enabled',
|
||||
'is_runware_enabled',
|
||||
'is_image_generation_enabled',
|
||||
'updated_at',
|
||||
]
|
||||
list_filter = [
|
||||
'is_openai_enabled',
|
||||
'is_runware_enabled',
|
||||
'is_image_generation_enabled',
|
||||
]
|
||||
search_fields = [
|
||||
'account__name',
|
||||
'account__domain',
|
||||
]
|
||||
readonly_fields = ['created_at', 'updated_at']
|
||||
fieldsets = (
|
||||
('Account', {
|
||||
'fields': ('account',)
|
||||
}),
|
||||
('Integration States', {
|
||||
'fields': (
|
||||
'is_openai_enabled',
|
||||
'is_runware_enabled',
|
||||
'is_image_generation_enabled',
|
||||
)
|
||||
}),
|
||||
('Timestamps', {
|
||||
'fields': ('created_at', 'updated_at'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
class AITaskLogResource(resources.ModelResource):
|
||||
"""Resource class for exporting AI Task Logs"""
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user