#NEWLINE# def lookup( self ) : #NEWLINE# #INDENT# 'Return the Farmer object for the bitcoin address passed.' #NEWLINE# farmer = Farmer . query . filter_by ( btc_addr = self . btc_addr ) . first ( ) #NEWLINE# if ( not farmer ) : #NEWLINE# #INDENT# msg = 'Address not registered: {0}' . format ( farmer . btc_addr ) #NEWLINE# logger . warning ( msg ) #NEWLINE# raise LookupError ( msg ) #NEWLINE# #UNINDENT# return farmer