@login_required
def status(request, code):
    _get_project_for_user(request, code)
    checks = list(Check.objects.filter(project__code=code))
    details = []
    for check in checks:
        ctx = {'check': check}
        details.append({'code': str(check.code), 'status': check.get_status(), 'last_ping': LAST_PING_TMPL.render(ctx), 'started': (check.last_start is not None)})
    (tags_statuses, num_down) = _tags_statuses(checks)
    return JsonResponse({'details': details, 'tags': tags_statuses, 'title': num_down_title(num_down)})
@login_required
def status(request, code):
    _get_project_for_user(request, code)
    checks = list(Check.objects.filter(project__code=code))
    details = []
    for check in checks:
        ctx = {'check': check}
        details.append({'code': str(check.code), 'status': check.get_status(), 'last_ping': LAST_PING_TMPL.render(ctx), 'started': (check.last_start is not None)})
    (tags_statuses, num_down) = _tags_statuses(checks)
    return JsonResponse({'details': details, 'tags': tags_statuses, 'title': num_down_title(num_down)})