• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python factory.content_orphan_manager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp.server.managers.factory.content_orphan_manager函数的典型用法代码示例。如果您正苦于以下问题:Python content_orphan_manager函数的具体用法?Python content_orphan_manager怎么用?Python content_orphan_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: POST

 def POST(self):
     orphans = self.params()
     orphan_manager = factory.content_orphan_manager()
     tags = [action_tag('delete_orphans'),
             resource_tag(dispatch_constants.RESOURCE_CONTENT_UNIT_TYPE, 'orphans')]
     call_request = CallRequest(orphan_manager.delete_orphans_by_id, [orphans], tags=tags, archive=True)
     return execution.execute_async(self, call_request)
开发者ID:jlsherrill,项目名称:pulp,代码行数:7,代码来源:contents.py


示例2: DELETE

 def DELETE(self, content_type, content_id):
     orphan_manager = factory.content_orphan_manager()
     orphan_manager.get_orphan(content_type, content_id)
     ids = [{'content_type_id': content_type, 'unit_id': content_id}]
     tags = [resource_tag(dispatch_constants.RESOURCE_CONTENT_UNIT_TYPE, 'orphans')]
     call_request = CallRequest(orphan_manager.delete_orphans_by_id, [ids], tags=tags, archive=True)
     return execution.execute_async(self, call_request)
开发者ID:jlsherrill,项目名称:pulp,代码行数:7,代码来源:contents.py


示例3: GET

 def GET(self, content_type):
     orphan_manager = factory.content_orphan_manager()
     # NOTE this can still potentially stomp on memory, but hopefully the
     # _with_unit_keys methods will reduce the foot print enough that
     # we'll never see this bug again
     orphans = list(orphan_manager.generate_orphans_by_type_with_unit_keys(content_type))
     map(lambda o: o.update(serialization.link.child_link_obj(o['_id'])), orphans)
     return self.ok(orphans)
开发者ID:cliffy94,项目名称:pulp,代码行数:8,代码来源:contents.py


示例4: delete

    def delete(self, request, content_type):
        """
        Dispatch a delete_orphans_by_type task.

        :param request: WSGI request object
        :type  request: django.core.handlers.wsgi.WSGIRequest
        :param content_type: restrict the list of orphans to be deleted to this content type
        :type  content_type: str

        :raises: OperationPostponed when an async operation is performed
        """
        orphan_manager = factory.content_orphan_manager()
        orphan_manager.validate_type(content_type)
        task_tags = [tags.resource_tag(tags.RESOURCE_CONTENT_UNIT_TYPE, "orphans")]
        async_task = content_orphan.delete_orphans_by_type.apply_async((content_type,), tags=task_tags)
        raise OperationPostponed(async_task)
开发者ID:credativ,项目名称:pulp,代码行数:16,代码来源:content.py


示例5: get

    def get(self, request, content_type, unit_id):
        """
        Return a serialized object representing the requested orphan

        :param request: WSGI request object
        :type  request: django.core.handlers.wsgi.WSGIRequest
        :param content_type: content type of the requested orphan
        :type  content_type: str
        :param unit_id: id of the requested unit
        :type  unit_id: str

        :return: response conainting a serialized dict of the requested orphan
        :rtype : django.http.HttpResponse
        """
        orphan_manager = factory.content_orphan_manager()
        orphan_dict = orphan_manager.get_orphan(content_type, unit_id)
        orphan_dict["_href"] = request.get_full_path()
        return generate_json_response(orphan_dict)
开发者ID:credativ,项目名称:pulp,代码行数:18,代码来源:content.py


示例6: test_factory

 def test_factory(self):
     try:
         manager_factory.content_orphan_manager()
     except:
         self.fail(traceback.format_exc())
开发者ID:domcleal,项目名称:pulp,代码行数:5,代码来源:test_content_orphan_manager.py


示例7: GET

 def GET(self, content_type, content_id):
     orphan_manager = factory.content_orphan_manager()
     orphan = orphan_manager.get_orphan(content_type, content_id)
     orphan.update(serialization.link.current_link_obj())
     return self.ok(orphan)
开发者ID:jlsherrill,项目名称:pulp,代码行数:5,代码来源:contents.py


示例8: clean_orphans

 def clean_orphans(self):
     """
     Exposes the ability to clean up this unit as an orphan.
     """
     orphan_manger = factory.content_orphan_manager()
     orphan_manger.delete_orphan_content_units_by_type(self._content_type_id, self.id)
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:6,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python factory.content_query_manager函数代码示例发布时间:2022-05-25
下一篇:
Python factory.content_manager函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap