本文整理汇总了Python中sentry.web.frontend.groups._get_group_list函数的典型用法代码示例。如果您正苦于以下问题:Python _get_group_list函数的具体用法?Python _get_group_list怎么用?Python _get_group_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_get_group_list函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: poll
def poll(request, project):
offset = 0
limit = settings.MESSAGES_PER_PAGE
view_id = request.GET.get('view_id')
if view_id:
try:
view = View.objects.get_from_cache(pk=view_id)
except View.DoesNotExist:
return HttpResponseBadRequest()
else:
view = None
response = _get_group_list(
request=request,
project=project,
view=view,
)
event_list = response['event_list']
event_list = list(event_list[offset:limit])
data = to_json(event_list, request)
response = HttpResponse(data)
response['Content-Type'] = 'application/json'
return response
开发者ID:davidszotten,项目名称:sentry,代码行数:27,代码来源:api.py
示例2: poll
def poll(request, project):
from sentry.templatetags.sentry_plugins import handle_before_events
offset = 0
limit = settings.MESSAGES_PER_PAGE
view_id = request.GET.get("view_id")
if view_id:
try:
view = View.objects.get_from_cache(pk=view_id)
except View.DoesNotExist:
return HttpResponseBadRequest()
else:
view = None
response = _get_group_list(request=request, project=project, view=view)
event_list = response["event_list"]
event_list = list(event_list[offset:limit])
handle_before_events(request, event_list)
data = transform_groups(request, event_list)
response = HttpResponse(json.dumps(data))
response["Content-Type"] = "application/json"
return response
开发者ID:nkabir,项目名称:sentry,代码行数:26,代码来源:api.py
示例3: poll
def poll(request, team, project):
offset = 0
limit = settings.MESSAGES_PER_PAGE
response = _get_group_list(request=request, project=project)
event_list = response["event_list"]
event_list = list(event_list[offset:limit])
return to_json(event_list, request)
开发者ID:rnoldo,项目名称:sentry,代码行数:10,代码来源:api.py
示例4: poll
def poll(request, team, project):
offset = 0
limit = EVENTS_PER_PAGE
response = _get_group_list(
request=request,
project=project,
)
event_list = response['event_list']
event_list = list(event_list[offset:limit])
return to_json(event_list, request)
开发者ID:DNIWE-Systems,项目名称:sentry,代码行数:13,代码来源:api.py
示例5: clear
def clear(request, project):
response = _get_group_list(
request=request,
project=project,
)
event_list = response['event_list']
event_list.update(status=1)
data = []
response = HttpResponse(json.dumps(data))
response['Content-Type'] = 'application/json'
return response
开发者ID:allanlei,项目名称:sentry,代码行数:13,代码来源:api.py
示例6: clear
def clear(request, team, project):
response = _get_group_list(request=request, project=project)
# TODO: should we record some kind of global event in Activity?
event_list = response["event_list"]
happened = event_list.update(status=STATUS_RESOLVED)
if happened:
Activity.objects.create(project=project, type=Activity.SET_RESOLVED, user=request.user)
data = []
response = HttpResponse(json.dumps(data))
response["Content-Type"] = "application/json"
return response
开发者ID:rnoldo,项目名称:sentry,代码行数:14,代码来源:api.py
示例7: clear
def clear(request, project):
response = _get_group_list(
request=request,
project=project,
)
# TODO: should we record some kind of global event in Activity?
event_list = response['event_list']
event_list.update(status=STATUS_RESOLVED)
data = []
response = HttpResponse(json.dumps(data))
response['Content-Type'] = 'application/json'
return response
开发者ID:brunoqc,项目名称:sentry,代码行数:14,代码来源:api.py
示例8: poll
def poll(request, organization, project):
offset = 0
limit = EVENTS_PER_PAGE
group_result = _get_group_list(
request=request,
project=project,
)
event_list = group_result['event_list']
event_list = list(event_list[offset:limit])
data = to_json(event_list, request)
links = [
('previous', str(group_result['prev_cursor'])),
('next', str(group_result['next_cursor'])),
]
querystring = u'&'.join(
u'{0}={1}'.format(urlquote(k), urlquote(v))
for k, v in request.GET.iteritems()
if k != 'cursor'
)
base_url = request.build_absolute_uri(request.path)
if querystring:
base_url = '{0}?{1}'.format(base_url, querystring)
else:
base_url = base_url + '?'
link_values = []
for name, cursor in links:
link_values.append(LINK_HEADER.format(
uri=base_url,
cursor=cursor,
name=name,
has_results='true' if bool(cursor) else 'false',
))
headers = {}
if link_values:
headers['Link'] = ', '.join(link_values)
response = HttpResponse(data)
response['Content-Type'] = 'application/json'
if link_values:
response['Link'] = ', '.join(link_values)
return response
开发者ID:rebeckag,项目名称:sentry,代码行数:48,代码来源:api.py
示例9: clear
def clear(request, team, project):
response = _get_group_list(request=request, project=project)
# TODO: should we record some kind of global event in Activity?
event_list = response["event_list"]
rows_affected = event_list.update(status=STATUS_RESOLVED)
if rows_affected > 1000:
logger.warning("Large resolve on %s of %s rows", project.slug, rows_affected)
if rows_affected:
Activity.objects.create(project=project, type=Activity.SET_RESOLVED, user=request.user)
data = []
response = HttpResponse(json.dumps(data))
response["Content-Type"] = "application/json"
return response
开发者ID:jonaskje,项目名称:sentry,代码行数:16,代码来源:api.py
示例10: poll
def poll(request, project):
offset = 0
limit = settings.MESSAGES_PER_PAGE
response = _get_group_list(
request=request,
project=project,
)
event_list = response['event_list']
event_list = list(event_list[offset:limit])
data = to_json(event_list, request)
response = HttpResponse(data)
response['Content-Type'] = 'application/json'
return response
开发者ID:alphachoi,项目名称:sentry,代码行数:17,代码来源:api.py
示例11: poll
def poll(request, project):
from sentry.templatetags.sentry_helpers import as_bookmarks
from sentry.templatetags.sentry_plugins import handle_before_events
offset = 0
limit = settings.MESSAGES_PER_PAGE
view_id = request.GET.get('view_id')
if view_id:
try:
view = View.objects.get_from_cache(pk=view_id)
except View.DoesNotExist:
return HttpResponseBadRequest()
else:
view = None
response = _get_group_list(
request=request,
project=project,
view=view,
)
event_list = response['event_list']
event_list = list(event_list[offset:limit])
handle_before_events(request, event_list)
data = [
{
'id': m.pk,
'html': render_to_string('sentry/partial/_group.html', {
'group': m,
'request': request,
'is_bookmarked': b,
}).strip(),
'title': m.message_top(),
'message': m.error(),
'level': m.get_level_display(),
'logger': m.logger,
'count': m.times_seen,
'score': getattr(m, 'sort_value', None),
} for m, b in as_bookmarks(event_list, request.user)]
response = HttpResponse(json.dumps(data))
response['Content-Type'] = 'application/json'
return response
开发者ID:SimpleTax,项目名称:sentry,代码行数:45,代码来源:api.py
示例12: clear
def clear(request, project):
view_id = request.GET.get("view_id")
if view_id:
try:
view = View.objects.get_from_cache(pk=view_id)
except View.DoesNotExist:
return HttpResponseBadRequest()
else:
view = None
_, event_list = _get_group_list(request=request, project=project, view=view)
event_list.update(status=1)
data = []
response = HttpResponse(json.dumps(data))
response["Content-Type"] = "application/json"
return response
开发者ID:rtnpro,项目名称:sentry,代码行数:18,代码来源:api.py
示例13: get
def get(self, request, team, project):
offset = 0
limit = 100
response = _get_group_list(
request=request,
project=project,
)
group_list = response['event_list']
group_list = list(group_list[offset:limit])
# TODO: need to make a custom serializer
results = transform(group_list, request)
for group in results:
group['uri'] = absolute_uri(reverse('sentry-api-0-group-details', args=(team.slug, project.slug, group['id'])))
return Response(results)
开发者ID:CaseCommonsDevOps,项目名称:sentry,代码行数:18,代码来源:group_index.py
示例14: poll
def poll(request, project):
from sentry.templatetags.sentry_helpers import as_bookmarks
from sentry.templatetags.sentry_plugins import handle_before_events
offset = 0
limit = settings.MESSAGES_PER_PAGE
view_id = request.GET.get("view_id")
if view_id:
try:
view = View.objects.get_from_cache(pk=view_id)
except View.DoesNotExist:
return HttpResponseBadRequest()
else:
view = None
response = _get_group_list(request=request, project=project, view=view)
event_list = response["event_list"]
event_list = list(event_list[offset:limit])
handle_before_events(request, event_list)
data = [
{
"id": m.pk,
"html": render_to_string(
"sentry/partial/_group.html", {"group": m, "request": request, "is_bookmarked": b}
).strip(),
"title": m.message_top(),
"message": m.error(),
"level": m.get_level_display(),
"logger": m.logger,
"count": m.times_seen,
"score": getattr(m, "sort_value", None),
}
for m, b in as_bookmarks(event_list, request.user)
]
response = HttpResponse(json.dumps(data))
response["Content-Type"] = "application/json"
return response
开发者ID:rtnpro,项目名称:sentry,代码行数:41,代码来源:api.py
注:本文中的sentry.web.frontend.groups._get_group_list函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论