#NEWLINE# def as_dict( self , prefix = None ) : #NEWLINE# #INDENT# with self . get_cursor ( ) as cursor : #NEWLINE# #INDENT# if ( prefix is None ) : #NEWLINE# #INDENT# cursor . execute ( self . query ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cursor . execute ( ( self . query + ' LIKE %s' ) , ( ( prefix + '%' ) , ) ) #NEWLINE# #UNINDENT# rows = cursor . fetchall ( ) #NEWLINE# return { name : self . _cast ( value ) for ( name , value ) in rows }