# Performance boost
* boosts performance of geometry conflict fetching 50-75%
This commit is contained in:
@@ -129,15 +129,21 @@ class Geometry(BaseResource):
|
|||||||
else:
|
else:
|
||||||
objs += set_objs
|
objs += set_objs
|
||||||
|
|
||||||
# ... but we need a special treatment for compensations, since they can be deleted directly OR inherit their
|
stop_searching = objs is not None
|
||||||
# de-facto-deleted status from their deleted parent intervention
|
if stop_searching:
|
||||||
comp_objs = self.compensation_set.filter(
|
break
|
||||||
Q(deleted=None) & Q(intervention__deleted=None)
|
|
||||||
)
|
search_for_comps = not objs
|
||||||
if limit_to_attrs:
|
if search_for_comps:
|
||||||
objs += comp_objs.values(*limit_to_attrs)
|
# ... but we need a special treatment for compensations, since they can be deleted directly OR inherit their
|
||||||
else:
|
# de-facto-deleted status from their deleted parent intervention
|
||||||
objs += comp_objs
|
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
|
return objs
|
||||||
|
|
||||||
def get_data_object(self, limit_to_attrs: list = None):
|
def get_data_object(self, limit_to_attrs: list = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user