6
6
from sqlalchemy .ext .asyncio import AsyncSession
7
7
from sqlalchemy_crud_plus import CRUDPlus
8
8
9
- from backend .app . admin .conf import admin_settings
10
- from backend .app . admin .model import Config
11
- from backend .app . admin .schema .config import CreateConfigParam , UpdateConfigParam
9
+ from backend .plugin . config .conf import config_settings
10
+ from backend .plugin . config .model import Config
11
+ from backend .plugin . config .schema .config import CreateConfigParam , UpdateConfigParam
12
12
13
13
14
14
class CRUDConfig (CRUDPlus [Config ]):
@@ -22,7 +22,7 @@ async def get(self, db: AsyncSession, pk: int) -> Config | None:
22
22
:param pk: 参数配置 ID
23
23
:return:
24
24
"""
25
- return await self .select_model_by_column (db , id = pk , type__not_in = admin_settings .CONFIG_BUILT_IN_TYPES )
25
+ return await self .select_model_by_column (db , id = pk , type__not_in = config_settings .CONFIG_BUILT_IN_TYPES )
26
26
27
27
async def get_by_type (self , db : AsyncSession , type : str ) -> Sequence [Config ]:
28
28
"""
@@ -63,7 +63,7 @@ async def get_list(self, name: str | None = None, type: str | None = None) -> Se
63
63
:param type: 参数配置类型
64
64
:return:
65
65
"""
66
- filters = {'type__not_in' : admin_settings .CONFIG_BUILT_IN_TYPES }
66
+ filters = {'type__not_in' : config_settings .CONFIG_BUILT_IN_TYPES }
67
67
if name is not None :
68
68
filters .update (name__like = f'%{ name } %' )
69
69
if type is not None :
@@ -100,7 +100,7 @@ async def delete(self, db: AsyncSession, pk: list[int]) -> int:
100
100
:return:
101
101
"""
102
102
return await self .delete_model_by_column (
103
- db , allow_multiple = True , id__in = pk , type__not_in = admin_settings .CONFIG_BUILT_IN_TYPES
103
+ db , allow_multiple = True , id__in = pk , type__not_in = config_settings .CONFIG_BUILT_IN_TYPES
104
104
)
105
105
106
106
0 commit comments