def _lookup_field(self, path):
        """ Searches for a field as defined by path. This method is used by the
            ``dependency`` evaluation logic.

        :param path: Path elements are separated by a ``.``. A leading ``^``
                     indicates that the path relates to the document root,
                     otherwise it relates to the currently evaluated document,
                     which is possibly a subdocument.
                     The sequence ``^^`` at the start will be interpreted as a
                     literal ``^``.
        :type path: :class:`str`
        :returns: Either the found field name and its value or :obj:`None` for
                  both.
        :rtype: A two-value :class:`tuple`.
        """
        if path.startswith('^'):
            path = path[1:]
            context = self.document if path.startswith('^') \
                else self.root_document
        else:
            context = self.document

        parts = path.split('.')
        for part in parts:
            if part not in context:
                return None, None
            context = context.get(part)

        return parts[-1], context
def _lookup_field ( self , path ) : if path . startswith ( '^' ) : path = path [ 1 : ] context = self . document if path . startswith ( '^' ) else self . root_document else : context = self . document parts = path . split ( '.' ) for part in parts : if part not in context : return None , None context = context . get ( part ) return parts [ - 1 ] , context
Searches for a field as defined by path. This method is used by the
            ``dependency`` evaluation logic.

        :param path: Path elements are separated by a ``.``. A leading ``^``
                     indicates that the path relates to the document root,
                     otherwise it relates to the currently evaluated document,
                     which is possibly a subdocument.
                     The sequence ``^^`` at the start will be interpreted as a
                     literal ``^``.
        :type path: :class:`str`
        :returns: Either the found field name and its value or :obj:`None` for
                  both.
        :rtype: A two-value :class:`tuple`.