|
|
@@ -153,7 +153,7 @@ class Noeud(QgsModel):
|
|
|
'NO_Y': {'empty': True, 'validator': is_float},
|
|
|
'NO_PRO': {'type': 'string', 'maxlength': 20, 'empty': False, 'allowed': ['MANCHE NUMERIQUE', 'COLLECTIVITE', 'ORANGE', 'ERDF', 'PRIVE', 'ENEDIS', 'AUTRE', 'NUL']},
|
|
|
'NO_GEST': {'type': 'string', 'maxlength': 20, 'empty': False, 'allowed': ['MANCHE NUMERIQUE', 'MANCHE TELECOM', 'COLLECTIVITE', 'ORANGE', 'ERDF', 'ENEDIS', 'MANCHE FIBRE', 'PRIVE', 'AUTRE', 'NUL']},
|
|
|
- 'NO_HAUT': {'validator': is_float},
|
|
|
+ 'NO_HAUT': {'empty': True, 'validator': is_float},
|
|
|
'NO_DATE_IN': {'empty': True, 'validator': is_modern_french_date},
|
|
|
'NO_REF_PLA': {'type': 'string', 'maxlength': 100},
|
|
|
'NO_SRC_GEO': {'type': 'string', 'maxlength': 50},
|
|
|
@@ -199,6 +199,7 @@ class Zapbo(QgsModel):
|
|
|
crs = CRS
|
|
|
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']},
|
|
|
'COMMENTAIR': {'type': 'string', 'maxlength': 254, 'empty': True},
|
|
|
'STATUT': {'type': 'string', 'empty': False, 'allowed': STATUTS}}
|
|
|
@@ -220,6 +221,8 @@ class Mn2Checker(BaseChecker):
|
|
|
for model in models:
|
|
|
model.layer = next((l for l in QgsProject.instance().mapLayers().values() \
|
|
|
if l.name().lower() == model.layername.lower()), None)
|
|
|
+ if not model.layer:
|
|
|
+ continue
|
|
|
self.dataset[model] = [model(f) for f in model.layer.getFeatures()]
|
|
|
|
|
|
self.arteres = self.dataset.get(Artere, [])
|
|
|
@@ -256,12 +259,12 @@ class Mn2Checker(BaseChecker):
|
|
|
"""
|
|
|
for model in models:
|
|
|
if model.layer is None:
|
|
|
- self.log_critical("Couche manquante", model=model)
|
|
|
+ self.log_error("Couche manquante", model=model)
|
|
|
continue
|
|
|
|
|
|
if model.pk:
|
|
|
if not model.pk.lower() in [f.name().lower() for f in model.layer.fields()]:
|
|
|
- self.log_critical(f"Clef primaire manquante ({model.pk})", model=model)
|
|
|
+ self.log_error(f"Clef primaire manquante ({model.pk})", model=model)
|
|
|
continue
|
|
|
|
|
|
def test_scr(self):
|