Example #1
0
def errors_snippet(request, pk=None):
    form, queryset = get_filtered(request)
    paginated = Paginator(queryset, 50)
    page = get_page(request, paginated)
    template = loader.get_template('list-snippet.html')
    html = template.render(RequestContext(request, {"object_list": page.object_list, }))
    return {"html":html, "count": len(page.object_list) }
Example #2
0
def notifications_list(request):
    queryset = Notification.objects.all().order_by("-timestamp")
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request, "notification_list.html", extra_context={
        "page": page,
        "nav": {"selected": "notifications"}
        })
Example #3
0
def groups_list(request):
    form, queryset = get_group_filtered(request)
    paginated = Paginator(queryset, 50)
    page = get_page(request, paginated)
    return direct_to_template(request, "group.html", extra_context={
        "page": page,
        "form": form,
        "nav": {"selected": "list", "subnav": "group"},
        })
Example #4
0
def notifications_list(request):
    queryset = Notification.all().order("-timestamp")
    # this number doesn't need to be high and its quite an expensive
    # page to generate
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request, "notification_list.html", extra_context={
        "page": page,
        "nav": {"selected": "notifications"}
        })
Example #5
0
def user_list(request):
    queryset = User.all()
    # this number doesn't need to be high and its quite an expensive
    # page to generate
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request, "user_list.html", extra_context={
        "page": page,
        "nav": {"selected": "setup"}
        })
Example #6
0
def issue_log_view(request, pk):
    issue = issue_by_number(pk)
    logs = Log.all().filter("issue = ", issue)
    paginated = Paginator(logs, 50)
    page = get_page(request, paginated)
    return direct_to_template(request, "issue_log_list.html", extra_context={
        "page": page,
        "issue": issue,
        "nav": {"selected": "issues", "subnav": "list"},
    })
Example #7
0
def user_list(request):
    queryset = User.all()
    # this number doesn't need to be high and its quite an expensive
    # page to generate
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request, "user_list.html", extra_context={
        "page": page,
        "nav": {"selected": "setup"}
        })
Example #8
0
def errors_list(request):
    form, queryset = get_filtered(request)
    paginated = Paginator(queryset, 50)
    page = get_page(request, paginated)
    if request.GET.get("lucky") and len(page.object_list):
        return HttpResponseRedirect(reverse("error-view", args=[page.object_list[0].id]))
    return direct_to_template(
        request,
        "list.html",
        extra_context={"page": page, "nav": {"selected": "list", "subnav": "list"}, "form": form, "refresh": True},
    )
Example #9
0
def errors_list(request):
    form, queryset = get_filtered(request)
    paginated = Paginator(queryset, 50)
    page = get_page(request, paginated)
    if request.GET.get("lucky") and len(page.object_list):
        return HttpResponseRedirect(reverse("error-view", args=[page.object_list[0].id,]))
    return direct_to_template(request, "list.html", extra_context={
        "page": page,
        "nav": {"selected": "list", "subnav": "list"},
        "form": form,
        "refresh": True
        })
Example #10
0
def notifications_list(request):
    queryset = Notification.objects.all().order_by("-timestamp")
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request,
                              "notification_list.html",
                              extra_context={
                                  "page": page,
                                  "nav": {
                                      "selected": "notifications"
                                  }
                              })
Example #11
0
def notifications_list(request):
    queryset = Notification.all().order("-timestamp")
    # this number doesn't need to be high and its quite an expensive
    # page to generate
    paginated = Paginator(queryset, 10)
    page = get_page(request, paginated)
    return direct_to_template(request,
                              "notification_list.html",
                              extra_context={
                                  "page": page,
                                  "nav": {
                                      "selected": "notifications"
                                  }
                              })
Example #12
0
def issue_log_view(request, pk):
    issue = issue_by_number(pk)
    logs = Log.all().filter("issue = ", issue)
    paginated = Paginator(logs, 50)
    page = get_page(request, paginated)
    return direct_to_template(request,
                              "issue_log_list.html",
                              extra_context={
                                  "page": page,
                                  "issue": issue,
                                  "nav": {
                                      "selected": "issues",
                                      "subnav": "list"
                                  },
                              })
Example #13
0
def errors_list(request):
    errors = Error.all().order("-timestamp")
    paginated = Paginator(errors, 50)
    page = get_page(request, paginated)
    return direct_to_template(request, "list.html", extra_context={"page":page})