#NEWLINE# def get_relations( self , cursor , table_name ) : #NEWLINE# #INDENT# '\n        Returns a dictionary of {field_index: (field_index_other_table, other_table)}\n        representing all relationships to the given table. Indexes are 0-based.\n        ' #NEWLINE# my_field_dict = self . _name_to_index ( cursor , table_name ) #NEWLINE# constraints = self . get_key_columns ( cursor , table_name ) #NEWLINE# relations = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( my_fieldname , other_table , other_field ) in constraints : #NEWLINE# #INDENT# other_field_index = self . _name_to_index ( cursor , other_table ) [ other_field ] #NEWLINE# my_field_index = my_field_dict [ my_fieldname ] #NEWLINE# relations [ my_field_index ] = ( other_field_index , other_table ) #NEWLINE# #UNINDENT# return relations