tinymongo.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:tinymongo 作者: schapman1974 项目源码 文件源码
def parse_query(self, query):
        """
        Creates a tinydb Query() object from the query dict

        :param query: object containing the dictionary representation of the
        query
        :return: composite Query()
        """
        logger.debug(u'query to parse2: {}'.format(query))

        # this should find all records
        if query == {} or query is None:
            return Query()._id != u'-1'  # noqa

        q = None
        # find the final result of the generator
        for c in self.parse_condition(query):
            if q is None:
                q = c
            else:
                q = q & c

        logger.debug(u'new query item2: {}'.format(q))

        return q
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号