bug fixed
parent
5f1b9da77e
commit
9e7e8eee4e
|
|
@ -2,13 +2,10 @@ from fastapi import FastAPI
|
|||
from sqladmin import Admin
|
||||
|
||||
from app.database.session import engine
|
||||
from app.lyric.api.lyrics_admin import (
|
||||
LyricsAttributeAdmin,
|
||||
LyricsPromptTemplateAdmin,
|
||||
LyricsSongResultsAllAdmin,
|
||||
LyricsSongSampleAdmin,
|
||||
LyricsStoreDefaultInfoAdmin,
|
||||
)
|
||||
from app.home.api.home_admin import ImageAdmin, ProjectAdmin
|
||||
from app.lyric.api.lyrics_admin import LyricAdmin
|
||||
from app.song.api.song_admin import SongAdmin
|
||||
from app.video.api.video_admin import VideoAdmin
|
||||
from config import prj_settings
|
||||
|
||||
# https://github.com/aminalaee/sqladmin
|
||||
|
|
@ -25,10 +22,17 @@ def init_admin(
|
|||
base_url=base_url,
|
||||
)
|
||||
|
||||
admin.add_view(LyricsStoreDefaultInfoAdmin)
|
||||
admin.add_view(LyricsAttributeAdmin)
|
||||
admin.add_view(LyricsSongSampleAdmin)
|
||||
admin.add_view(LyricsPromptTemplateAdmin)
|
||||
admin.add_view(LyricsSongResultsAllAdmin)
|
||||
# 프로젝트 관리
|
||||
admin.add_view(ProjectAdmin)
|
||||
admin.add_view(ImageAdmin)
|
||||
|
||||
# 가사 관리
|
||||
admin.add_view(LyricAdmin)
|
||||
|
||||
# 노래 관리
|
||||
admin.add_view(SongAdmin)
|
||||
|
||||
# 영상 관리
|
||||
admin.add_view(VideoAdmin)
|
||||
|
||||
return admin
|
||||
|
|
|
|||
|
|
@ -37,19 +37,16 @@ AsyncSessionLocal = async_sessionmaker(
|
|||
|
||||
|
||||
async def create_db_tables():
|
||||
async with engine.begin() as connection:
|
||||
from app.lyric.models import ( # noqa: F401
|
||||
Attribute,
|
||||
PromptTemplate,
|
||||
SongResultsAll,
|
||||
SongSample,
|
||||
StoreDefaultInfo,
|
||||
)
|
||||
import asyncio
|
||||
|
||||
# 모델 import (테이블 메타데이터 등록용)
|
||||
from app.home.models import Image, Project # noqa: F401
|
||||
from app.lyric.models import Lyric # noqa: F401
|
||||
from app.song.models import Song # noqa: F401
|
||||
from app.video.models import Video # noqa: F401
|
||||
|
||||
print("Creating database tables...")
|
||||
|
||||
import asyncio
|
||||
|
||||
async with asyncio.timeout(10):
|
||||
async with engine.begin() as connection:
|
||||
await connection.run_sync(Base.metadata.create_all)
|
||||
|
|
|
|||
Loading…
Reference in New Issue