updated docs

This commit is contained in:
2025-01-22 21:46:11 +03:00
parent 87e5f5ab06
commit 1ba2694a9d
50 changed files with 3342 additions and 401 deletions

View File

@@ -281,6 +281,7 @@ class Event2Employee(CrudCollection):
@classmethod
def get_event_endpoints(cls, employee_id: int) -> list:
from Schemas import EndpointRestriction
db = cls.new_session()
employee_events = cls.filter_all(
cls.employee_id == employee_id,
@@ -307,9 +308,7 @@ class Event2Employee(CrudCollection):
).data
active_events.extend(events_extra)
endpoint_restrictions = EndpointRestriction.filter_all(
EndpointRestriction.id.in_(
[event.endpoint_id for event in active_events]
),
EndpointRestriction.id.in_([event.endpoint_id for event in active_events]),
db=db,
).data
return [event.endpoint_name for event in endpoint_restrictions]
@@ -381,6 +380,7 @@ class Event2Occupant(CrudCollection):
@classmethod
def get_event_endpoints(cls, build_living_space_id) -> list:
from Schemas import EndpointRestriction
db = cls.new_session()
occupant_events = cls.filter_all(
cls.build_living_space_id == build_living_space_id,
@@ -407,13 +407,12 @@ class Event2Occupant(CrudCollection):
).data
active_events.extend(events_extra)
endpoint_restrictions = EndpointRestriction.filter_all(
EndpointRestriction.id.in_(
[event.endpoint_id for event in active_events]
),
EndpointRestriction.id.in_([event.endpoint_id for event in active_events]),
db=db,
).data
return [event.endpoint_name for event in endpoint_restrictions]
class ModulePrice(CrudCollection):
"""
ModulePrice class based on declarative_base and BaseMixin via session