updated postgres and mongo updated
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user