def migrate_guid(conflict_models):
 (case_conflicts, no_case_conflicts) = check_conflicts(conflict_models)
 print 'Case conflicts', case_conflicts
 print 'No-case conflicts', no_case_conflicts
 if case_conflicts:
  raise Exception('Unavoidable conflicts')
 for model in conflict_models:
  print 'Working on model', model._name
  for obj in model.find():
   if (obj is None):
    continue
   guid = models.Guid.load(obj._primary_key)
   print obj._primary_key
   if (guid is not None):
    if (guid._primary_key == guid._primary_key.lower()):
     continue
    if (guid._primary_key.lower() in no_case_conflicts):
     continue
    guid.remove_one(guid)
   if (obj._primary_key.lower() not in no_case_conflicts):
    obj._primary_key = obj._primary_key.lower()
    obj.save()
   obj._ensure_guid()
   check_pk_change(obj)

def migrate_guid ( conflict_models ) : ( case_conflicts , no_case_conflicts ) = check_conflicts ( conflict_models ) print 'Case conflicts' , case_conflicts print 'No-case conflicts' , no_case_conflicts if case_conflicts : raise Exception ( 'Unavoidable conflicts' ) for model in conflict_models : print 'Working on model' , model . _name for obj in model . find ( ) : if ( obj is None ) : continue guid = models . Guid . load ( obj . _primary_key ) print obj . _primary_key if ( guid is not None ) : if ( guid . _primary_key == guid . _primary_key . lower ( ) ) : continue if ( guid . _primary_key . lower ( ) in no_case_conflicts ) : continue guid . remove_one ( guid ) if ( obj . _primary_key . lower ( ) not in no_case_conflicts ) : obj . _primary_key = obj . _primary_key . lower ( ) obj . save ( ) obj . _ensure_guid ( ) check_pk_change ( obj )
check guid models for conflicts .