def migrate_guid_wiki(wiki):
 data = wiki.to_storage()
 uid = data.get('user')
 if uid:
  record = models.User.load(uid.lower())
  if record:
   wiki.user = record
 pid = data.get('node')
 if pid:
  record = models.Node.load(pid.lower())
  if record:
   wiki.node = record
 wiki.save()

def migrate_guid_wiki ( wiki ) : data = wiki . to_storage ( ) uid = data . get ( 'user' ) if uid : record = models . User . load ( uid . lower ( ) ) if record : wiki . user = record pid = data . get ( 'node' ) if pid : record = models . Node . load ( pid . lower ( ) ) if record : wiki . node = record wiki . save ( )
migrate non-reference fields containing primary keys on wiki pages .