Bump sqlalchemy crud plus version to 1.5.0 (#450)

This commit is contained in:
Wu Clan
2024-11-07 13:42:40 +08:00
committed by GitHub
parent aabb72138a
commit 0cfeeb4e45
4 changed files with 912 additions and 915 deletions
+1 -4
View File
@@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-
from typing import Sequence
from sqlalchemy import update
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy_crud_plus import CRUDPlus
@@ -50,9 +49,7 @@ class CRUDGenModel(CRUDPlus[GenModel]):
:param pd_type:
:return:
"""
stmt = update(self.model).where(self.model.id == pk).values(**obj_in.model_dump(), pd_type=pd_type)
result = await db.execute(stmt)
return result.rowcount
return await self.update_model(db, pk, obj_in, pd_type=pd_type)
async def delete(self, db: AsyncSession, pk: int) -> int:
"""