Skip to content

Commit f064b1d

Browse files
committed
Add layer filtering
1 parent 09b3568 commit f064b1d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

arho_feature_template/project/layers/plan_layers.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,21 @@ def get_regulations_to_delete(cls, regulations: list[Regulation], group_id: str)
429429

430430
class TypeOfVerbalRegulationAssociationLayer(AbstractPlanLayer):
431431
name = "Sanallisten kaavamääräyksien lajien assosiaatiot"
432-
filter_template = None
432+
filter_template = Template(
433+
dedent(
434+
"""\
435+
EXISTS (
436+
SELECT 1
437+
FROM
438+
hame.plan_regulation_group prg
439+
JOIN hame.plan_regulation pr
440+
ON (prg.id = pr.plan_regulation_group_id)
441+
WHERE
442+
hame.type_of_verbal_regulation_association.plan_regulation_id = pr.id
443+
AND prg.plan_id = '$plan_id'
444+
)"""
445+
)
446+
)
433447

434448
@classmethod
435449
def feature_from(cls, regulation_id: str, type_of_verbal_regulation_id: str) -> QgsFeature | None:

0 commit comments

Comments
 (0)