dal.py 文件源码

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

项目:StuffShare 作者: StuffShare 项目源码 文件源码
def select(self, query, fields, attributes):
        """
        Always returns a Rows object, possibly empty.
        """
        sql = self._select(query, fields, attributes)
        cache = attributes.get('cache', None)
        if cache and attributes.get('cacheable', False):
            del attributes['cache']
            (cache_model, time_expire) = cache
            key = self.uri + '/' + sql
            if len(key) > 200: key = hashlib_md5(key).hexdigest()
            args = (sql, fields, attributes)
            return cache_model(
                key,
                lambda self=self, args=args: self._select_aux(*args),
                time_expire)
        else:
            return self._select_aux(sql, fields, attributes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号