# Performance boost
* boosts performance of geometry conflict fetching 50-75%
This commit is contained in:
@@ -129,10 +129,16 @@ class Geometry(BaseResource):
|
|||||||
else:
|
else:
|
||||||
objs += set_objs
|
objs += set_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
|
# ... 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
|
# de-facto-deleted status from their deleted parent intervention
|
||||||
comp_objs = self.compensation_set.filter(
|
comp_objs = self.compensation_set.filter(
|
||||||
Q(deleted=None) & Q(intervention__deleted=None)
|
Q(deleted=None) | Q(intervention__deleted=None)
|
||||||
)
|
)
|
||||||
if limit_to_attrs:
|
if limit_to_attrs:
|
||||||
objs += comp_objs.values(*limit_to_attrs)
|
objs += comp_objs.values(*limit_to_attrs)
|
||||||
|
|||||||
Reference in New Issue
Block a user