sql.py 文件源码

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

项目:annotated-py-sqlalchemy 作者: hhstore 项目源码 文件源码
def hash_key(self):
        # selects call alot of stuff so we do some "recursion checking"
        # to eliminate loops
        if Select._hash_recursion.push(self):
            return "recursive_select()"
        try:
            return "Select(%s)" % string.join(
                [
                    "columns=" + string.join([util.hash_key(c) for c in self._raw_columns],','),
                    "where=" + util.hash_key(self.whereclause),
                    "from=" + string.join([util.hash_key(f) for f in self.froms],','),
                    "having=" + util.hash_key(self.having),
                    "clauses=" + string.join([util.hash_key(c) for c in self.clauses], ',')
                ] + ["%s=%s" % (k, repr(getattr(self, k))) for k in ['use_labels', 'distinct', 'limit', 'offset']], ","
            ) 
        finally:
            Select._hash_recursion.pop(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号