equal
deleted
inserted
replaced
315 def check_mandatory_relations(schema, session, eids, fix=1): |
315 def check_mandatory_relations(schema, session, eids, fix=1): |
316 """check entities missing some mandatory relation""" |
316 """check entities missing some mandatory relation""" |
317 print 'Checking mandatory relations' |
317 print 'Checking mandatory relations' |
318 msg = '%s #%s is missing mandatory %s relation %s (autofix will delete the entity)' |
318 msg = '%s #%s is missing mandatory %s relation %s (autofix will delete the entity)' |
319 for rschema in schema.relations(): |
319 for rschema in schema.relations(): |
320 if rschema.final or rschema.type in PURE_VIRTUAL_RTYPES: |
320 if rschema.final or rschema in PURE_VIRTUAL_RTYPES or rschema in ('is', 'is_instance_of'): |
321 continue |
321 continue |
322 smandatory = set() |
322 smandatory = set() |
323 omandatory = set() |
323 omandatory = set() |
324 for rdef in rschema.rdefs.values(): |
324 for rdef in rschema.rdefs.values(): |
325 if rdef.cardinality[0] in '1+': |
325 if rdef.cardinality[0] in '1+': |