#NEWLINE# def _parse_index_value( self , kwargs ) : #NEWLINE# #INDENT# "\n        Parse the HANDLER-supported subset of django's __ expression syntax\n        " #NEWLINE# if ( len ( kwargs ) == 0 ) : #NEWLINE# #INDENT# return ( None , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( kwargs ) > 1 ) : #NEWLINE# #INDENT# raise ValueError ( "You can't pass more than one value expression, you passed {}" . format ( ',' . join ( kwargs . keys ( ) ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# ( name , value ) = list ( kwargs . items ( ) ) [ 0 ] #NEWLINE# if ( not name . startswith ( 'value' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'The keyword arg {} is not valid for this function' . format ( name ) ) #NEWLINE# #UNINDENT# if ( name == 'value' ) : #NEWLINE# #INDENT# return ( '=' , value ) #NEWLINE# #UNINDENT# if ( not name . startswith ( 'value__' ) ) : #NEWLINE# #INDENT# raise ValueError ( 'The keyword arg {} is not valid for this function' . format ( self ) ) #NEWLINE# #UNINDENT# operator = name [ ( name . find ( '__' ) + 2 ) : ] #NEWLINE# try : #NEWLINE# #INDENT# return ( self . _operator_values [ operator ] , value ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# raise ValueError ( 'The operator {op} is not valid for index value matching. Valid operators are {valid}' . format ( op = operator , valid = ',' . join ( self . _operator_values . keys ( ) ) ) )