当前位置: 首页>>代码示例>>Python>>正文


Python Criteria.as_dict方法代码示例

本文整理汇总了Python中pulp.server.db.model.criteria.Criteria.as_dict方法的典型用法代码示例。如果您正苦于以下问题:Python Criteria.as_dict方法的具体用法?Python Criteria.as_dict怎么用?Python Criteria.as_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pulp.server.db.model.criteria.Criteria的用法示例。


在下文中一共展示了Criteria.as_dict方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from pulp.server.db.model.criteria import Criteria [as 别名]
# 或者: from pulp.server.db.model.criteria.Criteria import as_dict [as 别名]
    def post(self, request, consumer_id):
        """
        Creates an async task to regenerate content applicability data for given consumer.

        :param request: WSGI request object
        :type request: django.core.handlers.wsgi.WSGIRequest
        :param consumer_id: The consumer ID.
        :type consumer_id: str

        :raises MissingResource: if some parameters are missing
        :raises OperationPostponed: when an async operation is performed.
        """

        consumer_query_manager = factory.consumer_query_manager()
        if consumer_query_manager.find_by_id(consumer_id) is None:
            raise MissingResource(consumer_id=consumer_id)
        consumer_criteria = Criteria(filters={'consumer_id': consumer_id})

        task_tags = [tags.action_tag('consumer_content_applicability_regeneration')]
        async_result = regenerate_applicability_for_consumers.apply_async_with_reservation(
            tags.RESOURCE_CONSUMER_TYPE,
            consumer_id,
            (consumer_criteria.as_dict(),),
            tags=task_tags)
        raise OperationPostponed(async_result)
开发者ID:alanoe,项目名称:pulp,代码行数:27,代码来源:consumers.py

示例2: POST

# 需要导入模块: from pulp.server.db.model.criteria import Criteria [as 别名]
# 或者: from pulp.server.db.model.criteria.Criteria import as_dict [as 别名]
    def POST(self, consumer_id):
        """
        Creates an async task to regenerate content applicability data for given consumer.

        :param consumer_id: The consumer ID.
        :type consumer_id: basestring
        """
        consumer_query_manager = managers.consumer_query_manager()
        if consumer_query_manager.find_by_id(consumer_id) is None:
            raise MissingResource(consumer_id=consumer_id)
        consumer_criteria = Criteria(filters={'consumer_id': consumer_id})

        task_tags = [tags.action_tag('consumer_content_applicability_regeneration')]
        async_result = regenerate_applicability_for_consumers.apply_async_with_reservation(
            tags.RESOURCE_CONSUMER_TYPE,
            consumer_id,
            (consumer_criteria.as_dict(),),
            tags=task_tags)
        raise OperationPostponed(async_result)
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:21,代码来源:consumers.py


注:本文中的pulp.server.db.model.criteria.Criteria.as_dict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。