# Performance boost
* boosts performance of geometry conflict fetching 50-75%
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user