#NEWLINE# def to_map( self , dbcols , refcols ) : #NEWLINE# #INDENT# 'Convert a foreign key definition to a YAML-suitable format\n\n        :param dbcols: dictionary of dbobject columns\n        :return: dictionary\n        ' #NEWLINE# dct = self . _base_map ( ) #NEWLINE# del dct [ '_table' ] #NEWLINE# dct [ 'columns' ] = [ dbcols [ ( k - 1 ) ] for k in self . col_idx ] #NEWLINE# del dct [ 'col_idx' ] #NEWLINE# refsch = ( ( hasattr ( self , 'ref_schema' ) and self . ref_schema ) or self . schema ) #NEWLINE# ref_col_names = [ refcols [ ( k - 1 ) ] for k in self . ref_col_idxs ] #NEWLINE# dct [ 'references' ] = { #NEWLINE# #INDENT# 'table' : refcols [ 'ref_table' ] , #NEWLINE# 'columns' : ref_col_names , #NEWLINE# #UNINDENT# } #NEWLINE# if ( 'ref_schema' in dct ) : #NEWLINE# #INDENT# dct [ 'references' ] . update ( schema = refsch ) #NEWLINE# del dct [ 'ref_schema' ] #NEWLINE# #UNINDENT# del dct [ 'ref_table' ] , dct [ 'ref_col_idxs' ] #NEWLINE# return { #NEWLINE# #INDENT# self . name : dct , #NEWLINE# #UNINDENT# }