#NEWLINE# def filter( self , * args , **kwargs ) : #NEWLINE# #INDENT# for ( key , value ) in kwargs . items ( ) : #NEWLINE# #INDENT# key = key . replace ( '__exact' , '' ) #NEWLINE# parts = key . split ( '->' ) #NEWLINE# if ( len ( parts ) == 2 ) : #NEWLINE# #INDENT# key = "{0}->>'{1}'" . format ( parts [ 0 ] , parts [ 1 ] ) #NEWLINE# value = six . u ( '{0}' . format ( value ) ) #NEWLINE# #UNINDENT# if hasattr ( value , 'id' ) : #NEWLINE# #INDENT# key = '{0}_id' . format ( key ) #NEWLINE# self . json_query . where ( ** { #NEWLINE# #INDENT# '{0}' . format ( key ) : value . id , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . json_query . where ( ** { #NEWLINE# #INDENT# key : value , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return self