equal
deleted
inserted
replaced
284 for entity in session.execute(rql).entities(): |
284 for entity in session.execute(rql).entities(): |
285 print >> sys.stderr, '%s #%s is missing mandatory %s relation %s' % ( |
285 print >> sys.stderr, '%s #%s is missing mandatory %s relation %s' % ( |
286 entity.__regid__, entity.eid, role, rschema) |
286 entity.__regid__, entity.eid, role, rschema) |
287 if fix: |
287 if fix: |
288 #if entity.cw_describe()['source']['uri'] == 'system': XXX |
288 #if entity.cw_describe()['source']['uri'] == 'system': XXX |
289 entity.delete() |
289 entity.cw_delete() |
290 notify_fixed(fix) |
290 notify_fixed(fix) |
291 |
291 |
292 |
292 |
293 def check_mandatory_attributes(schema, session, eids, fix=1): |
293 def check_mandatory_attributes(schema, session, eids, fix=1): |
294 """check for entities stored in the system source missing some mandatory |
294 """check for entities stored in the system source missing some mandatory |
304 rschema, rdef.subject) |
304 rschema, rdef.subject) |
305 for entity in session.execute(rql).entities(): |
305 for entity in session.execute(rql).entities(): |
306 print >> sys.stderr, '%s #%s is missing mandatory attribute %s' % ( |
306 print >> sys.stderr, '%s #%s is missing mandatory attribute %s' % ( |
307 entity.__regid__, entity.eid, rschema) |
307 entity.__regid__, entity.eid, rschema) |
308 if fix: |
308 if fix: |
309 entity.delete() |
309 entity.cw_delete() |
310 notify_fixed(fix) |
310 notify_fixed(fix) |
311 |
311 |
312 |
312 |
313 def check_metadata(schema, session, eids, fix=1): |
313 def check_metadata(schema, session, eids, fix=1): |
314 """check entities has required metadata |
314 """check entities has required metadata |