alchemy functions updated

This commit is contained in:
2024-11-10 12:14:10 +03:00
parent 1f75e49a07
commit e01a2c8afb
24 changed files with 543 additions and 389 deletions

View File

@@ -181,12 +181,16 @@ class Event2Occupant(CrudCollection):
def get_event_id_by_build_living_space_id(
cls, build_living_space_id
) -> (list, list):
active_events = cls.filter_by_active(
build_living_space_id=build_living_space_id
)
active_events_id = [event.event_id for event in active_events.data]
active_events = Events.filter_active(Events.id.in_(active_events_id))
active_events_uu_id = [str(event.uu_id) for event in active_events.data]
active_events = cls.filter_all(
cls.build_living_space_id==build_living_space_id,
*cls.valid_record_args(cls)
).data
active_events_id = [event.event_id for event in active_events]
active_events = Events.filter_all(
Events.id.in_(active_events_id),
*Events.valid_record_args(Events)
).data
active_events_uu_id = [str(event.uu_id) for event in active_events]
return active_events_id, active_events_uu_id