@@ -200,30 +200,31 @@ def post_generate(self, project):
200200
201201 # 1:m relation will be added only if does not point to a pure link table
202202 if (
203- not (
204- relation .referencing_layer .isPureLinkTable (project )
205- or relation .referencing_layer .is_basket_table
206- )
203+ not relation .referencing_layer .isPureLinkTable (project )
207204 or Qgis .QGIS_VERSION_INT < 31600
208205 ):
209206 relations_to_add .append ((relation , None ))
210207
211- for nm_relation in project .relations :
212- if nm_relation == relation :
213- continue
208+ else :
209+ for nm_relation in project .relations :
210+ if nm_relation == relation :
211+ continue
214212
215- if nm_relation .referenced_layer == self :
216- continue
213+ if nm_relation .referenced_layer == self :
214+ continue
217215
218- # relations to the same table with different geometries should not be added
219- if nm_relation .referenced_layer .srid == self .srid :
220- continue
216+ # relations to the same table with different geometries should not be added
217+ if nm_relation .referenced_layer .srid == self .srid :
218+ continue
221219
222- if nm_relation .referenced_layer .is_basket_table :
223- continue
220+ if nm_relation .referenced_layer .is_basket_table :
221+ continue
224222
225- if nm_relation .referencing_layer == relation .referencing_layer :
226- relations_to_add .append ((relation , nm_relation ))
223+ if (
224+ nm_relation .referencing_layer
225+ == relation .referencing_layer
226+ ):
227+ relations_to_add .append ((relation , nm_relation ))
227228
228229 for relation , nm_relation in relations_to_add :
229230 if nm_relation and Qgis .QGIS_VERSION_INT < 31600 :
0 commit comments