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


Python EventUser.for_tags方法代码示例

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


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

示例1: test_for_tags

# 需要导入模块: from sentry.models import EventUser [as 别名]
# 或者: from sentry.models.EventUser import for_tags [as 别名]
 def test_for_tags(self):
     eu = EventUser.objects.create(
         project_id=1,
         ident='matt',
     )
     assert EventUser.for_tags(1, ['id:matt']) == {'id:matt': eu}
     assert EventUser.for_tags(1, ['id:doesnotexist']) == {}
     assert EventUser.for_tags(1, ['id:matt', 'id:doesnotexist']) == {'id:matt': eu}
开发者ID:Kayle009,项目名称:sentry,代码行数:10,代码来源:test_eventuser.py

示例2: find_event_user

# 需要导入模块: from sentry.models import EventUser [as 别名]
# 或者: from sentry.models.EventUser import for_tags [as 别名]
    def find_event_user(self, report):
        try:
            event = Event.objects.get(
                group_id=report.group_id,
                event_id=report.event_id,
            )
        except Event.DoesNotExist:
            if not report.email:
                return None
            try:
                return EventUser.objects.filter(
                    project_id=report.project_id,
                    email=report.email,
                )[0]
            except IndexError:
                return None

        tag = event.get_tag('sentry:user')
        if not tag:
            return None

        try:
            return EventUser.for_tags(
                project_id=report.project_id,
                values=[tag],
            )[tag]
        except KeyError:
            pass
开发者ID:NuttasitBoonwat,项目名称:sentry,代码行数:30,代码来源:project_user_reports.py

示例3: get_attrs

# 需要导入模块: from sentry.models import EventUser [as 别名]
# 或者: from sentry.models.EventUser import for_tags [as 别名]
    def get_attrs(self, item_list, user):
        users = EventUser.for_tags(project_id=item_list[0].project_id, values=[t.value for t in item_list])

        result = {}
        for item in item_list:
            result[item] = {"user": users.get(item.value)}
        return result
开发者ID:pythorn,项目名称:sentry,代码行数:9,代码来源:tagvalue.py

示例4: get_attrs

# 需要导入模块: from sentry.models import EventUser [as 别名]
# 或者: from sentry.models.EventUser import for_tags [as 别名]
    def get_attrs(self, item_list, user):
        users = EventUser.for_tags(
            project_id=self.project_id,
            values=[t.value for t in item_list],
        )

        result = {}
        for item in item_list:
            result[item] = {
                'user': users.get(item.value),
            }
        return result
开发者ID:Kayle009,项目名称:sentry,代码行数:14,代码来源:tagvalue.py

示例5: wrapped

# 需要导入模块: from sentry.models import EventUser [as 别名]
# 或者: from sentry.models.EventUser import for_tags [as 别名]
 def wrapped(items):
     users = EventUser.for_tags(project_id, [i.value for i in items])
     for item in items:
         item._eventuser = users.get(item.value)
开发者ID:hosmelq,项目名称:sentry,代码行数:6,代码来源:group_tag_export.py


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