events updated
This commit is contained in:
@@ -196,7 +196,6 @@ class Build(CrudCollection, SelectActionWithEmployee):
|
||||
foreign_keys="BuildDecisionBook.build_id",
|
||||
)
|
||||
|
||||
#
|
||||
# build_ibans: Mapped["BuildIbans"] = relationship(
|
||||
# "BuildIbans", back_populates="building", foreign_keys="BuildIbans.build_id"
|
||||
# )
|
||||
@@ -271,21 +270,20 @@ class Build(CrudCollection, SelectActionWithEmployee):
|
||||
@classmethod
|
||||
def update_action(cls, data: UpdateBuild, build_uu_id: str, token):
|
||||
from databases import Addresses
|
||||
print('data_dict', data.dump())
|
||||
|
||||
print("data_dict", data.dump())
|
||||
data_dict = data.excluded_dump()
|
||||
if data.address_uu_id:
|
||||
official_address = Addresses.filter_one(
|
||||
Addresses.uu_id == data.address_uu_id
|
||||
).data
|
||||
data_dict["address_id"] = official_address.id if official_address else None
|
||||
print('data_dict', data_dict)
|
||||
if build_to_update := cls.filter_one(
|
||||
cls.uu_id == build_uu_id
|
||||
).data:
|
||||
print('build_to_update', build_to_update.get_dict())
|
||||
print("data_dict", data_dict)
|
||||
if build_to_update := cls.filter_one(cls.uu_id == build_uu_id).data:
|
||||
print("build_to_update", build_to_update.get_dict())
|
||||
updated_build = build_to_update.update(**data_dict)
|
||||
updated_build.save()
|
||||
print('updated_build', updated_build.get_dict())
|
||||
print("updated_build", updated_build.get_dict())
|
||||
return updated_build
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user