#NEWLINE# @ connected #NEWLINE# def what_references( self , arg ) : #NEWLINE# #INDENT# 'Show fields referencing the input table/field arg.\n\n        If arg is a tablename, then print fields which reference\n        any field in tablename. If arg is a field (specified by\n        tablename.fieldname), then print only fields which reference\n        the specified table.field.\n\n        Args:\n            arg: Either a table name or a [table.field] name' #NEWLINE# with pager ( ) as out : #NEWLINE# #INDENT# bits = arg . split ( '.' , 1 ) #NEWLINE# tablename = bits [ 0 ] #NEWLINE# fieldname = ( bits [ 1 ] if ( len ( bits ) > 1 ) else None ) #NEWLINE# fks = self . get_metadata ( ) . fields_referencing ( tablename , fieldname ) #NEWLINE# for fk in fks : #NEWLINE# #INDENT# out . write ( ( str ( fk ) . encode ( 'utf8' ) + b'\n' ) )