updated postgres and mongo updated

This commit is contained in:
2025-04-20 14:21:13 +03:00
parent 71822681f2
commit cc19cb7e6d
85 changed files with 6090 additions and 1986 deletions

View File

@@ -347,16 +347,14 @@ class BuildParts(CrudCollection):
{"comment": "Part objects that are belong to building objects"},
)
@property
def part_name(self):
with self.new_session() as db_session:
if build_type := BuildTypes.filter_by_one(
system=True, id=self.part_type_id, db=db_session
).data:
return (
f"{str(build_type.type_name).upper()} : {str(self.part_no).upper()}"
)
return f"Undefined:{str(build_type.type_name).upper()}"
def part_name(self, db):
if build_type := BuildTypes.filter_by_one(
system=True, id=self.part_type_id, db=db
).data:
return (
f"{str(build_type.type_name).upper()} : {str(self.part_no).upper()}"
)
return f"Undefined:{str(build_type.type_name).upper()}"
class BuildLivingSpace(CrudCollection):
@@ -405,7 +403,7 @@ class BuildLivingSpace(CrudCollection):
person_uu_id: Mapped[str] = mapped_column(
String, nullable=False, comment="Responsible People UUID"
)
occupant_type: Mapped[int] = mapped_column(
occupant_type_id: Mapped[int] = mapped_column(
ForeignKey("occupant_types.id"),
nullable=False,
comment="Occupant Type",