home, lyric, song, video에 대한 app 추가, 각 app별 모델 추가, admin 추가, debug 모드 추가, lifespan에 debug시 동작하는 것으로 업데이트

This commit is contained in:
bluebamus committed 2025-12-20 23:16:35 +09:00
1 parent 6180c23151
commit 5f1b9da77e
74 files changed
+3437 -416

No files matched your search

+62
View File
@@ -0,0 +1,62 @@
from sqladmin import ModelView
from app.song.models import Song
class SongAdmin(ModelView, model=Song):
name = "노래"
name_plural = "노래 목록"
icon = "fa-solid fa-headphones"
category = "노래 관리"
page_size = 20
column_list = [
"id",
"project_id",
"lyric_id",
"task_id",
"status",
"created_at",
]
column_details_list = [
"id",
"project_id",
"lyric_id",
"task_id",
"status",
"song_prompt",
"song_result_url_1",
"song_result_url_2",
"created_at",
]
# 폼(생성/수정)에서 제외
form_excluded_columns = ["created_at", "videos"]
column_searchable_list = [
Song.task_id,
Song.status,
]
column_default_sort = (Song.created_at, True) # True: DESC (최신순)
column_sortable_list = [
Song.id,
Song.project_id,
Song.lyric_id,
Song.status,
Song.created_at,
]
column_labels = {
"id": "ID",
"project_id": "프로젝트 ID",
"lyric_id": "가사 ID",
"task_id": "작업 ID",
"status": "상태",
"song_prompt": "프롬프트",
"song_result_url_1": "결과 URL 1",
"song_result_url_2": "결과 URL 2",
"created_at": "생성일시",
}