Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ProFastCode committed Jul 29, 2024
1 parent ef9b1a2 commit 4b6cccd
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/repositories/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import abc
from typing import (Any, Generic, List, NoReturn, Optional, Sequence, Type,
TypeAlias, TypeVar)
from typing import (
Any,
Generic,
List,
NoReturn,
Optional,
Sequence,
Type,
TypeAlias,
TypeVar,
)

import sqlmodel as sm
from sqlmodel.ext.asyncio.session import AsyncSession

AbstractModel = TypeVar('AbstractModel', bound=sm.SQLModel)
AbstractModel = TypeVar("AbstractModel", bound=sm.SQLModel)
WhereClauses: TypeAlias = Optional[List[sm.DefaultClause | bool]]


Expand Down Expand Up @@ -53,4 +62,3 @@ async def retrieve_many(
async def delete(self, instance: AbstractModel) -> NoReturn:
await self.session.delete(instance)
await self.session.flush()
await self.session.commit()

0 comments on commit 4b6cccd

Please sign in to comment.