本文整理汇总了Python中sentry.models.Group.get_absolute_url方法的典型用法代码示例。如果您正苦于以下问题:Python Group.get_absolute_url方法的具体用法?Python Group.get_absolute_url怎么用?Python Group.get_absolute_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.models.Group
的用法示例。
在下文中一共展示了Group.get_absolute_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_note
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import get_absolute_url [as 别名]
def new_note(request):
org = Organization(
id=1,
slug='example',
name='Example',
)
team = Team(
id=1,
slug='example',
name='Example',
organization=org,
)
project = Project(
id=1,
slug='example',
name='Example',
team=team,
organization=org,
)
group = Group(
id=1,
project=project,
message='This is an example event.',
)
event = Event(
id=1,
project=project,
group=group,
message=group.message,
data=load_data('python'),
)
note = Activity(
group=event.group, event=event, project=event.project,
type=Activity.NOTE, user=request.user,
data={'text': 'This is an example note!'},
)
preview = MailPreview(
html_template='sentry/emails/activity/note.html',
text_template='sentry/emails/activity/note.txt',
context={
'data': note.data,
'author': note.user,
'date': note.datetime,
'group': group,
'link': group.get_absolute_url(),
},
)
return render_to_response('sentry/debug/mail/preview.html', {
'preview': preview,
})
示例2: assigned
# 需要导入模块: from sentry.models import Group [as 别名]
# 或者: from sentry.models.Group import get_absolute_url [as 别名]
def assigned(request):
org = Organization(
id=1,
slug='example',
name='Example',
)
team = Team(
id=1,
slug='example',
name='Example',
organization=org,
)
project = Project(
id=1,
slug='example',
name='Example',
team=team,
organization=org,
)
group = Group(
id=1,
project=project,
message='This is an example event.',
)
event = Event(
id=1,
project=project,
group=group,
message=group.message,
data=load_data('python'),
)
assigned = Activity(
group=event.group, event=event, project=event.project,
type=Activity.ASSIGNED, user=request.user,
data={'text': 'This is an example note!'},
)
return MailPreview(
html_template='sentry/emails/activity/assigned.html',
text_template='sentry/emails/activity/assigned.txt',
context={
'data': assigned.data,
'author': assigned.user,
'date': assigned.datetime,
'group': group,
'link': group.get_absolute_url(),
},
).render()