|
|
@@ -200,7 +200,7 @@ class Zapbo(QgsModel):
|
|
|
bounding_box = (XMIN,YMIN,XMAX,YMAX)
|
|
|
pk = "ID_ZAPBO"
|
|
|
required = False
|
|
|
- schema = {'ID_ZAPBO': {'type': 'string', 'empty': False, 'maxlength': 30, 'contains_any_of': ['PBO', 'BPE', 'PEC']},
|
|
|
+ schema = {'ID_ZAPBO': {'type': 'string', 'empty': False, 'maxlength': 30, 'contains_any_of': ['PBO', 'BPE', 'PEC', 'BAI']},
|
|
|
'COMMENTAIR': {'type': 'string', 'maxlength': 254, 'empty': True},
|
|
|
'STATUT': {'type': 'string', 'empty': False, 'allowed': STATUTS}}
|
|
|
|
|
|
@@ -367,15 +367,57 @@ class Mn2Checker(BaseChecker):
|
|
|
Recherche d'éventuels doublons dans des champs qui supposent l'unicité
|
|
|
"""
|
|
|
|
|
|
+ # doublons dans AR_CODE
|
|
|
tmp = []
|
|
|
- for noeud in self.noeuds:
|
|
|
- if not noeud.NO_NOM:
|
|
|
+ for artere in self.arteres:
|
|
|
+ if not artere.AR_CODE:
|
|
|
continue
|
|
|
- if not noeud.NO_NOM in tmp:
|
|
|
- tmp.append(noeud.NO_NOM)
|
|
|
+ if not artere.AR_CODE in tmp:
|
|
|
+ tmp.append(artere.AR_CODE)
|
|
|
else:
|
|
|
- self.log_error("Doublons dans le champs NO_NOM", item=noeud)
|
|
|
+ self.log_error("Doublons dans le champs AR_CODE", item=artere)
|
|
|
+
|
|
|
+ # doublons dans AR_NOM
|
|
|
+ tmp = []
|
|
|
+ for artere in self.arteres:
|
|
|
+ if not artere.AR_NOM:
|
|
|
+ continue
|
|
|
+ if not artere.AR_NOM in tmp:
|
|
|
+ tmp.append(artere.AR_NOM)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs AR_NOM", item=artere)
|
|
|
+
|
|
|
+ # doublons dans CA_CODE
|
|
|
+ tmp = []
|
|
|
+ for cable in self.cables:
|
|
|
+ if not cable.CA_CODE:
|
|
|
+ continue
|
|
|
+ if not cable.CA_CODE in tmp:
|
|
|
+ tmp.append(cable.CA_CODE)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs CA_CODE", item=cable)
|
|
|
+
|
|
|
+ # doublons dans CA_NOM
|
|
|
+ tmp = []
|
|
|
+ for cable in self.cables:
|
|
|
+ if not cable.CA_NOM:
|
|
|
+ continue
|
|
|
+ if not cable.CA_NOM in tmp:
|
|
|
+ tmp.append(cable.CA_NOM)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs CA_NOM", item=cable)
|
|
|
+
|
|
|
+ # doublons dans EQ_CODE
|
|
|
+ tmp = []
|
|
|
+ for equipement in self.equipements:
|
|
|
+ if not equipement.EQ_CODE:
|
|
|
+ continue
|
|
|
+ if not equipement.EQ_CODE in tmp:
|
|
|
+ tmp.append(equipement.EQ_CODE)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs EQ_CODE", item=equipement)
|
|
|
|
|
|
+ # doublons dans EQ_NOM
|
|
|
tmp = []
|
|
|
for equipement in self.equipements:
|
|
|
if not equipement.EQ_NOM:
|
|
|
@@ -384,7 +426,48 @@ class Mn2Checker(BaseChecker):
|
|
|
tmp.append(equipement.EQ_NOM)
|
|
|
else:
|
|
|
self.log_error("Doublons dans le champs EQ_NOM", item=equipement)
|
|
|
-
|
|
|
+
|
|
|
+ # doublons dans NO_CODE
|
|
|
+ tmp = []
|
|
|
+ for noeud in self.noeuds:
|
|
|
+ if not noeud.NO_CODE:
|
|
|
+ continue
|
|
|
+ if not noeud.NO_CODE in tmp:
|
|
|
+ tmp.append(noeud.NO_CODE)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs NO_CODE", item=noeud)
|
|
|
+
|
|
|
+ # doublons dans NO_NOM
|
|
|
+ tmp = []
|
|
|
+ for noeud in self.noeuds:
|
|
|
+ if not noeud.NO_NOM:
|
|
|
+ continue
|
|
|
+ if not noeud.NO_NOM in tmp:
|
|
|
+ tmp.append(noeud.NO_NOM)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs NO_NOM", item=noeud)
|
|
|
+
|
|
|
+ # doublons dans TR_CODE
|
|
|
+ tmp = []
|
|
|
+ for tranchee in self.tranchees:
|
|
|
+ if not tranchee.TR_CODE:
|
|
|
+ continue
|
|
|
+ if not tranchee.TR_CODE in tmp:
|
|
|
+ tmp.append(tranchee.TR_CODE)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs TR_CODE", item=tranchee)
|
|
|
+
|
|
|
+ # doublons dans TR_NOM
|
|
|
+ tmp = []
|
|
|
+ for tranchee in self.tranchees:
|
|
|
+ if not tranchee.TR_NOM:
|
|
|
+ continue
|
|
|
+ if not tranchee.TR_NOM in tmp:
|
|
|
+ tmp.append(tranchee.TR_NOM)
|
|
|
+ else:
|
|
|
+ self.log_error("Doublons dans le champs TR_NOM", item=tranchee)
|
|
|
+
|
|
|
+ # doublons dans ID_ZAPBO
|
|
|
tmp = []
|
|
|
for zapbo in self.zapbos:
|
|
|
if not zapbo.ID_ZAPBO:
|