63 lines
1.3 KiB
Python
63 lines
1.3 KiB
Python
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": "생성일시",
|
|
}
|