15 lines
428 B
Python
15 lines
428 B
Python
from sqlalchemy import select
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from models.project import Project
|
|
|
|
|
|
class ProjectRepository:
|
|
def __init__(self, session: AsyncSession):
|
|
self.session = session
|
|
|
|
async def get_all(self) -> list[Project]:
|
|
stmt = select(Project).where(Project.is_deleted.is_(False))
|
|
result = await self.session.execute(stmt)
|
|
return list(result.scalars().all())
|