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


Python Group.from_share_id方法代码示例

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


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

示例1: get

# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
    def get(self, request, share_id):
        """
        Retrieve an aggregate

        Return details on an individual aggregate specified by it's shared ID.

            {method} {path}

        Note: This is not the equivilant of what you'd receive with the standard
        group details endpoint. Data is more restrictive and designed
        specifically for sharing.

        """
        try:
            group = Group.from_share_id(share_id)
        except Group.DoesNotExist:
            raise ResourceDoesNotExist

        if group.organization.flags.disable_shared_issues:
            raise ResourceDoesNotExist

        event = group.get_latest_event()

        context = serialize(group, request.user, SharedGroupSerializer())
        context['latestEvent'] = serialize(event, request.user, SharedEventSerializer())

        # TODO(dcramer): use specific serializer for public group and embed
        # event details as part of api response
        return Response(context)
开发者ID:IthacaDream,项目名称:sentry,代码行数:31,代码来源:shared_group_details.py

示例2: get

# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
    def get(self, request):
        """
        Retrieve an aggregate

        Return details on an individual aggregate specified by query parameters.

            {method} {path}?shareId=mnIX

        """
        share_id = request.GET.get('shareId')
        if share_id:
            try:
                group = Group.from_share_id(share_id)
            except Group.DoesNotExist:
                group = None
        else:
            group = None

        if not group:
            return Response({'detail': 'No groups found'}, status=404)

        return client.get('/groups/{}/'.format(group.id), request.user, request.auth)
开发者ID:carriercomm,项目名称:sentry-1,代码行数:24,代码来源:group_index.py

示例3: test_invalid_shared_id

# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import from_share_id [as 别名]
 def test_invalid_shared_id(self):
     with pytest.raises(Group.DoesNotExist):
         Group.from_share_id('adc7a5b902184ce3818046302e94f8ec')
开发者ID:yaoqi,项目名称:sentry,代码行数:5,代码来源:test_group.py


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