def _parse_lookup_string(self, lookup_chain):
        """Convert a lookup string to a (lookup_chain, comparator) tuple."""
        lookup_chain = lookup_chain.split('__')
        comparator = self.default_comparator

        # Only look for a lookup method if the lookup chain is larger than 1
        if len(lookup_chain) <= 1:
            return lookup_chain, comparator

        # Get the correct lookup_method if the last value in the lookup
        # chain is a lookup method specifier
        if lookup_chain[-1] in self.comparators:
            comparator = self.comparators.get(lookup_chain.pop(-1))

        return lookup_chain, comparator
def _parse_lookup_string ( self , lookup_chain ) : lookup_chain = lookup_chain . split ( '__' ) comparator = self . default_comparator if len ( lookup_chain ) <= 1 : return lookup_chain , comparator if lookup_chain [ - 1 ] in self . comparators : comparator = self . comparators . get ( lookup_chain . pop ( - 1 ) ) return lookup_chain , comparator
Convert a lookup string to a (lookup_chain, comparator) tuple.