55from sqlalchemy .ext .asyncio import AsyncSession
66from sqlalchemy_crud_plus import CRUDPlus
77
8- from backend .core .conf import settings
98from backend .plugin .config .model import Config
109from backend .plugin .config .schema .config import CreateConfigParam , UpdateConfigParam
1110
@@ -21,7 +20,7 @@ async def get(self, db: AsyncSession, pk: int) -> Config | None:
2120 :param pk: 参数配置 ID
2221 :return:
2322 """
24- return await self .select_model_by_column (db , id = pk , type__not_in = settings . CONFIG_BUILT_IN_TYPES )
23+ return await self .select_model_by_column (db , id = pk )
2524
2625 async def get_by_key (self , db : AsyncSession , key : str ) -> Config | None :
2726 """
@@ -41,7 +40,7 @@ async def get_list(self, name: str | None, type: str | None) -> Select:
4140 :param type: 参数配置类型
4241 :return:
4342 """
44- filters = {'type__not_in' : settings . CONFIG_BUILT_IN_TYPES }
43+ filters = {}
4544
4645 if name is not None :
4746 filters ['name__like' ] = f'%{ name } %'
@@ -79,9 +78,7 @@ async def delete(self, db: AsyncSession, pks: list[int]) -> int:
7978 :param pks: 参数配置 ID 列表
8079 :return:
8180 """
82- return await self .delete_model_by_column (
83- db , allow_multiple = True , id__in = pks , type__not_in = settings .CONFIG_BUILT_IN_TYPES
84- )
81+ return await self .delete_model_by_column (db , allow_multiple = True , id__in = pks )
8582
8683
8784config_dao : CRUDConfig = CRUDConfig (Config )
0 commit comments