Skip to content

Commit

Permalink
Multiedit fix N:M listing of childrens
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Feb 10, 2024
1 parent 502f5f6 commit 3741aec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions linking_relation_editor/gui/linking_relation_editor_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import os
from enum import IntEnum
import copy

from qgis.core import (
Qgis,
Expand Down Expand Up @@ -426,10 +427,10 @@ def updateUiMultiEdit(self):
treeWidgetItem.addChild(treeWidgetItemChild)
featureIdsMixedValues.add(featureChildChild.id())

if treeWidgetItem in multimapChildFeatures:
multimapChildFeatures[treeWidgetItem].append(featureChildChild.id())
if id(treeWidgetItem) in multimapChildFeatures:
multimapChildFeatures[id(treeWidgetItem)].append(featureChildChild.id())
else:
multimapChildFeatures[treeWidgetItem] = [featureChildChild.id()]
multimapChildFeatures[id(treeWidgetItem)] = [featureChildChild.id()]

else:
treeWidgetItemChild = self.createMultiEditTreeWidgetItem(
Expand All @@ -453,10 +454,10 @@ def updateUiMultiEdit(self):
# See https://github.com/qgis/QGIS/pull/45703
#
if self.nmRelation().isValid():
for featureIdMixedValue in featureIdsMixedValues[:]:
for featureIdMixedValue in copy.copy(featureIdsMixedValues):
mixedValues = True
for parentTreeWidgetItem in parentTreeWidgetItems:
if featureIdMixedValue in multimapChildFeatures[parentTreeWidgetItem]:
if featureIdMixedValue in multimapChildFeatures[id(parentTreeWidgetItem)]:
mixedValues = True
break

Expand Down

0 comments on commit 3741aec

Please sign in to comment.