refactor(database): rename filename to find the models by table name easily

This commit is contained in:
MingxuanGame
2025-10-03 03:33:47 +00:00
parent 40670c094b
commit 37b4eadf79
58 changed files with 76 additions and 115 deletions

View File

@@ -23,7 +23,7 @@ from sqlmodel import (
from sqlmodel.ext.asyncio.session import AsyncSession
if TYPE_CHECKING:
from .lazer_user import User, UserResp
from .user import User, UserResp
class UserStatisticsBase(SQLModel):
@@ -122,7 +122,7 @@ class UserStatisticsResp(UserStatisticsBase):
"progress": int(math.fmod(obj.level_current, 1) * 100),
}
if "user" in include:
from .lazer_user import RANKING_INCLUDES, UserResp
from .user import RANKING_INCLUDES, UserResp
user = await UserResp.from_db(await obj.awaitable_attrs.user, session, include=RANKING_INCLUDES)
s.user = user
@@ -149,7 +149,7 @@ class UserStatisticsResp(UserStatisticsBase):
async def get_rank(session: AsyncSession, statistics: UserStatistics, country: str | None = None) -> int | None:
from .lazer_user import User
from .user import User
query = select(
UserStatistics.user_id,