From 11ae3d6d9ea45130d5ee95d16eec88692647633c Mon Sep 17 00:00:00 2001 From: shri Date: Fri, 30 Aug 2024 20:54:28 +0200 Subject: [PATCH] Fix list query --- src/app/domain/jobs/repositories.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/domain/jobs/repositories.py b/src/app/domain/jobs/repositories.py index b13578d8..655332f1 100644 --- a/src/app/domain/jobs/repositories.py +++ b/src/app/domain/jobs/repositories.py @@ -12,9 +12,7 @@ if TYPE_CHECKING: from advanced_alchemy.filters import FilterTypes -__all__ = ( - "JobPostRepository", -) +__all__ = ("JobPostRepository",) class JobPostRepository(SQLAlchemyAsyncRepository[JobPost]): @@ -33,11 +31,7 @@ async def get_job_posts( return await self.list_and_count( *filters, - statement=select(JobPost) - .order_by(JobPost.created_at) - .options( - joinedload(JobPost.company, isouter=True), - ), + statement=select(JobPost).order_by(JobPost.created_at).options(), auto_expunge=auto_expunge, force_basic_query_mode=force_basic_query_mode, **kwargs,