#NEWLINE# def create_lookup( lookup_def ) : #NEWLINE# #INDENT# for ( _ , cls ) in inspect . getmembers ( lookups_module ) : #NEWLINE# #INDENT# if ( inspect . isclass ( cls ) and issubclass ( cls , ExtraFieldLookup ) and cls . matches_lookup_def ( _ ) ) : #NEWLINE# #INDENT# return cls ( ) #NEWLINE# #UNINDENT# #UNINDENT# raise LookupDoesNotExist ( ( 'No Lookup found for %s .' % lookup_def ) )