#NEWLINE# def _lookup_reverse_constraint( self , table_name , column_name = None ) : #NEWLINE# #INDENT# 'Look for the column referenced by a foreign constraint' #NEWLINE# db_name = self . _get_setting ( 'NAME' ) #NEWLINE# if self . dry_run : #NEWLINE# #INDENT# raise DryRunError ( 'Cannot get constraints for columns.' ) #NEWLINE# #UNINDENT# if ( not self . _is_valid_cache ( db_name , table_name ) ) : #NEWLINE# #INDENT# self . lookup_constraint ( db_name , table_name ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# table = self . _reverse_cache [ db_name ] [ table_name ] #NEWLINE# if ( column_name == None ) : #NEWLINE# #INDENT# return [ ( x , tuple ( y ) ) for ( x , y ) in table . items ( ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return tuple ( table [ column_name ] ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return [ ]