diff --git a/AKModel/models.py b/AKModel/models.py index 3a1c4bbae35c13d4c5fb91e1b3e8adc8d7bbe4b9..267f0bb07f09a03d6f7cf18460f6295d2a0f9357 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -953,13 +953,19 @@ class AKSlot(models.Model): return [] return [f"availability-person-{owner.pk}"] + conflict_slots = AKSlot.objects.filter(ak__in=self.ak.conflicts.all()) + dependency_slots = AKSlot.objects.filter(ak__in=self.ak.prerequisites.all()) + ceil_offet_eps = decimal.Decimal(1e-4) # self.slots_in_an_hour is set in AKJSONExportView data = { "id": str(self.pk), "duration": math.ceil(self.duration * self.slots_in_an_hour - ceil_offet_eps), - "properties": {}, + "properties": { + "conflicts": [str(conflict.pk) for conflict in conflict_slots.all()], + "dependencies": [str(dep.pk) for dep in dependency_slots.all()], + }, "room_constraints": [constraint.name for constraint in self.ak.requirements.all()], "time_constraints": ["resolution"] if self.ak.reso else [],