549 rework geometry conflict fetching #552

Merged
mpeltriaux merged 2 commits from 549_Rework_GeometryConflict_fetching into master 2026-06-27 09:31:08 +02:00
Showing only changes of commit f551763798 - Show all commits
+15 -9
View File
@@ -129,15 +129,21 @@ class Geometry(BaseResource):
else:
objs += set_objs
# ... but we need a special treatment for compensations, since they can be deleted directly OR inherit their
# de-facto-deleted status from their deleted parent intervention
comp_objs = self.compensation_set.filter(
Q(deleted=None) & Q(intervention__deleted=None)
)
if limit_to_attrs:
objs += comp_objs.values(*limit_to_attrs)
else:
objs += comp_objs
stop_searching = objs is not None
if stop_searching:
break
search_for_comps = not objs
if search_for_comps:
# ... but we need a special treatment for compensations, since they can be deleted directly OR inherit their
# de-facto-deleted status from their deleted parent intervention
comp_objs = self.compensation_set.filter(
Q(deleted=None) | Q(intervention__deleted=None)
)
if limit_to_attrs:
objs += comp_objs.values(*limit_to_attrs)
else:
objs += comp_objs
return objs
def get_data_object(self, limit_to_attrs: list = None):