Skip to content

Commit dd556d9

Browse files
committed
Optimize feature deletion
Let the database delete child features.
1 parent 261e550 commit dd556d9

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

arho_feature_template/core/plan_manager.py

-17
Original file line numberDiff line numberDiff line change
@@ -625,22 +625,8 @@ def delete_regulation_group(regulation_group: RegulationGroup, plan_id: str | No
625625
feature = RegulationGroupLayer.feature_from_model(regulation_group, plan_id)
626626
layer = RegulationGroupLayer.get_from_project()
627627

628-
# Delete regulations
629-
for regulation in regulation_group.regulations:
630-
delete_regulation(regulation)
631-
632-
# Delete propositions
633-
for proposition in regulation_group.propositions:
634-
delete_proposition(proposition)
635-
636628
_delete_feature(feature, layer, "Kaavamääräysryhmän poisto")
637629

638-
# # Handle assocations
639-
# associations = RegulationGroupAssociationLayer.get_associations_for_regulation_group(str(regulation_group.id_))
640-
# association_layer = RegulationGroupAssociationLayer.get_from_project()
641-
# for association in associations:
642-
# _delete_feature(association, association_layer, "Kaavamääräysryhmän assosiaation poisto")
643-
644630

645631
def save_regulation_group_as_config(regulation_group: RegulationGroup):
646632
pass
@@ -697,9 +683,6 @@ def delete_regulation(regulation: Regulation):
697683
feature = PlanRegulationLayer.feature_from_model(regulation)
698684
layer = PlanRegulationLayer.get_from_project()
699685

700-
for ai in regulation.additional_information:
701-
delete_additional_information(ai)
702-
703686
_delete_feature(feature, layer, "Kaavamääräyksen poisto")
704687

705688

0 commit comments

Comments
 (0)