resource.py 文件源码

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

项目:dati-ckan-docker 作者: italia 项目源码 文件源码
def get_all_without_views(cls, formats=[]):
        '''Returns all resources that have no resource views

        :param formats: if given, returns only resources that have no resource
            views and are in any of the received formats
        :type formats: list

        :rtype: list of ckan.model.Resource objects
        '''
        query = meta.Session.query(cls).outerjoin(ckan.model.ResourceView) \
                    .filter(ckan.model.ResourceView.id == None)

        if formats:
            lowercase_formats = [f.lower() for f in formats]
            query = query.filter(func.lower(cls.format).in_(lowercase_formats))

        return query.all()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号