def find_bad_registrations():
 registrations = models.Node.find(Q('is_registration', 'eq', True))
 for registration in registrations:
  meta = (registration.registered_meta or {})
  keys = meta.keys()
  if (len(keys) != 1):
   print 'Inconsistency: Number of keys on project {} ({}) != 1'.format(registration.title, registration._primary_key)
   continue
  if (keys[0] not in known_schemas):
   print 'Inconsistency: Registration schema {} on project {} ({}) not in known schemas'.format(keys[0], registration.title, registration._primary_key)

def find_bad_registrations ( ) : registrations = models . Node . find ( Q ( 'is_registration' , 'eq' , True ) ) for registration in registrations : meta = ( registration . registered_meta or { } ) keys = meta . keys ( ) if ( len ( keys ) != 1 ) : print 'Inconsistency: Number of keys on project {} ({}) != 1' . format ( registration . title , registration . _primary_key ) continue if ( keys [ 0 ] not in known_schemas ) : print 'Inconsistency: Registration schema {} on project {} ({}) not in known schemas' . format ( keys [ 0 ] , registration . title , registration . _primary_key )
find registrations with unexpected numbers of template keys or outdated templates .