Files
Crm-Backend/repositories/project.py
2025-08-03 10:34:54 +04:00

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())