mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
revert accidental changes
This commit is contained in:
parent
31c2e07a02
commit
ade6891ff0
1 changed files with 10 additions and 26 deletions
|
|
@ -32,15 +32,11 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
self._session = session
|
||||
|
||||
def get_plan_by_uploaded_file_id(self, uploaded_file_id: int) -> Optional[Plan]:
|
||||
plan_row = (
|
||||
self._session.execute( # pyright: ignore[reportDeprecated]
|
||||
select(MagicPlanPlanModel).where(
|
||||
col(MagicPlanPlanModel.uploaded_file_id) == uploaded_file_id
|
||||
)
|
||||
plan_row = self._session.execute( # pyright: ignore[reportDeprecated]
|
||||
select(MagicPlanPlanModel).where(
|
||||
col(MagicPlanPlanModel.uploaded_file_id) == uploaded_file_id
|
||||
)
|
||||
.scalars()
|
||||
.one_or_none()
|
||||
)
|
||||
).scalars().one_or_none()
|
||||
if plan_row is None:
|
||||
return None
|
||||
|
||||
|
|
@ -51,9 +47,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
select(MagicPlanFloorModel).where(
|
||||
col(MagicPlanFloorModel.magic_plan_plan_id) == plan_id
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
)
|
||||
floor_ids = [cast(int, f.id) for f in floor_rows]
|
||||
|
||||
|
|
@ -62,9 +56,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
select(MagicPlanRoomModel).where(
|
||||
col(MagicPlanRoomModel.magic_plan_floor_id).in_(floor_ids)
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
)
|
||||
room_ids = [cast(int, r.id) for r in room_rows]
|
||||
|
||||
|
|
@ -73,9 +65,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
select(MagicPlanWindowModel).where(
|
||||
col(MagicPlanWindowModel.magic_plan_room_id).in_(room_ids)
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
)
|
||||
window_ids = [cast(int, w.id) for w in window_rows]
|
||||
|
||||
|
|
@ -84,9 +74,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
select(MagicPlanDoorModel).where(
|
||||
col(MagicPlanDoorModel.magic_plan_room_id).in_(room_ids)
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
)
|
||||
door_ids = [cast(int, d.id) for d in door_rows]
|
||||
|
||||
|
|
@ -98,9 +86,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
window_ids
|
||||
)
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
}
|
||||
door_vent_by_door_id = {
|
||||
cast(int, dv.magic_plan_door_id): dv
|
||||
|
|
@ -108,9 +94,7 @@ class MagicPlanPostgresRepository(MagicPlanRepository):
|
|||
select(MagicPlanDoorVentilationModel).where(
|
||||
col(MagicPlanDoorVentilationModel.magic_plan_door_id).in_(door_ids)
|
||||
)
|
||||
)
|
||||
.scalars()
|
||||
.all()
|
||||
).scalars().all()
|
||||
}
|
||||
|
||||
windows_by_room_id: dict[int, list[Window]] = {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue