Skip to content

Commit 0fa342f

Browse files
committed
fix: use where correctly in bulk update and delete
1 parent a00c8e2 commit 0fa342f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

fastapi_sqlalchemy_toolkit/model_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ async def bulk_update(
746746
stmt = update(self.model).values(update_data)
747747
if ids:
748748
stmt = stmt.where(self.model.id.in_(ids))
749-
elif where:
749+
elif where is not None:
750750
stmt = stmt.where(where)
751751
if returning:
752752
stmt = stmt.returning(self.model)
@@ -802,7 +802,7 @@ async def bulk_delete(
802802
stmt = delete(self.model)
803803
if ids:
804804
stmt = stmt.where(self.model.id.in_(ids))
805-
elif where:
805+
elif where is not None:
806806
stmt = stmt.where(where)
807807
await session.execute(stmt)
808808
await self.save(session, commit=commit)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "fastapi_sqlalchemy_toolkit"
7-
version = "0.7.11"
7+
version = "0.7.12"
88
authors = [
99
{ name="Egor Kondrashov", email="e.kondr01@gmail.com" },
1010
]

0 commit comments

Comments
 (0)