From patchwork Wed Jun 29 16:56:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 2371 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 0ADDB24060 for ; Wed, 29 Jun 2011 16:56:45 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id AEF41A1882E for ; Wed, 29 Jun 2011 16:56:44 +0000 (UTC) Received: by qwb8 with SMTP id 8so1005524qwb.11 for ; Wed, 29 Jun 2011 09:56:44 -0700 (PDT) Received: by 10.229.62.194 with SMTP id y2mr797670qch.4.1309366603977; Wed, 29 Jun 2011 09:56:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.48.135 with SMTP id r7cs46501qcf; Wed, 29 Jun 2011 09:56:43 -0700 (PDT) Received: by 10.227.195.13 with SMTP id ea13mr958798wbb.0.1309366602905; Wed, 29 Jun 2011 09:56:42 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id ej18si2922284wbb.97.2011.06.29.09.56.42; Wed, 29 Jun 2011 09:56:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qby48-0002Wk-8m for ; Wed, 29 Jun 2011 16:56:40 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 49FA72EE4B0 for ; Wed, 29 Jun 2011 16:56:26 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 236 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 236: This branch adds two new views for looking at data views (list of and Message-Id: <20110629165626.29507.92070.launchpad@loganberry.canonical.com> Date: Wed, 29 Jun 2011 16:56:26 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13265"; Instance="initZopeless config overlay" X-Launchpad-Hash: 5cd5036fcb60c50aad7f7d897ba7b9c6838e3808 Merge authors: Zygmunt Krynicki (zkrynicki) Related merge proposals: https://code.launchpad.net/~zkrynicki/lava-dashboard/data-views-views/+merge/66350 proposed by: Zygmunt Krynicki (zkrynicki) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 236 [merge] committer: Paul Larson branch nick: lava-dashboard timestamp: Wed 2011-06-29 17:53:11 +0100 message: This branch adds two new views for looking at data views (list of and details) added: dashboard_app/templates/dashboard_app/data_view_detail.html dashboard_app/templates/dashboard_app/data_view_list.html modified: dashboard_app/templates/dashboard_app/base.html dashboard_app/urls.py dashboard_app/views.py --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/templates/dashboard_app/base.html' --- dashboard_app/templates/dashboard_app/base.html 2011-06-29 14:00:01 +0000 +++ dashboard_app/templates/dashboard_app/base.html 2011-06-29 16:41:01 +0000 @@ -5,6 +5,7 @@ {% block extension_navigation %} === added file 'dashboard_app/templates/dashboard_app/data_view_detail.html' --- dashboard_app/templates/dashboard_app/data_view_detail.html 1970-01-01 00:00:00 +0000 +++ dashboard_app/templates/dashboard_app/data_view_detail.html 2011-06-29 16:41:01 +0000 @@ -0,0 +1,41 @@ +{% extends "dashboard_app/base.html" %} +{% load i18n %} + +{% block title %} +{{ block.super }} | {% trans "Data Views" %} | {{ data_view.name }} +{% endblock %} + + +{% block breadcrumbs %} +
  • {% trans "Data Views" %}
  • +
  • {{ data_view.name }}
  • +{% endblock %} + + +{% block content %} +
    +
    Name:
    +
    {{ data_view.name }}
    +
    Summary:
    +
    {{ data_view.summary }}
    +
    Documentation:
    +
    {{ data_view.documentation }}
    +
    + + + + + + + + + {% for argument in data_view.arguments %} + + + + + + + {% endfor %} +
    Aruments
    nametypedefaulthelp
    {{ argument.name }}{{ argument.type }}{{ argument.default|default_if_none:"No default available" }}{{ argument.help }}
    +{% endblock %} === added file 'dashboard_app/templates/dashboard_app/data_view_list.html' --- dashboard_app/templates/dashboard_app/data_view_list.html 1970-01-01 00:00:00 +0000 +++ dashboard_app/templates/dashboard_app/data_view_list.html 2011-06-29 16:41:01 +0000 @@ -0,0 +1,34 @@ +{% extends "dashboard_app/base.html" %} +{% load i18n %} + +{% block title %} +{{ block.super }} | {% trans "Data Views" %} +{% endblock %} + + +{% block breadcrumbs %} +
  • {% trans "Data Views" %}
  • +{% endblock %} + + +{% block sidebar %} +

    Hint:

    +

    To call a data view use the lava-dashboard-tool command. See +lava-dashboard-tool query-data-view --help to get started.

    +{% endblock %} + + +{% block content %} + + + + + + {% for data_view in data_view_list %} + + + + +{% endfor %} +
    {% trans "Name" %}{% trans "Summary" %}
    {{ data_view.name }}{{ data_view.summary }}
    +{% endblock %} === modified file 'dashboard_app/urls.py' --- dashboard_app/urls.py 2011-06-29 07:18:00 +0000 +++ dashboard_app/urls.py 2011-06-29 16:41:01 +0000 @@ -33,6 +33,8 @@ url(r'^streams(?P/[a-zA-Z0-9/_-]+?)\+bundles$', 'bundle_list'), url(r'^attachments/(?P[0-9]+)/$', 'attachment_detail'), url(r'^xml-rpc/', 'dashboard_xml_rpc_handler'), + url(r'^data-views/$', 'data_view_list'), + url(r'^data-views/(?P[a-zA-Z0-9-_]+)/$', 'data_view_detail'), url(r'^reports/$', 'report_list'), url(r'^reports/(?P[a-zA-Z0-9-_]+)/$', 'report_detail'), ) === modified file 'dashboard_app/views.py' --- dashboard_app/views.py 2011-05-30 17:43:28 +0000 +++ dashboard_app/views.py 2011-06-29 16:41:01 +0000 @@ -29,8 +29,9 @@ from django.shortcuts import render_to_response from django.template import RequestContext +from dashboard_app.dataview import DataView, DataViewRepository from dashboard_app.dispatcher import DjangoXMLRPCDispatcher -from dashboard_app.models import (Attachment, BundleStream, TestRun, TestResult, DataReport) +from dashboard_app.models import Attachment, BundleStream, TestRun, TestResult, DataReport from dashboard_app.xmlrpc import DashboardAPI @@ -255,3 +256,23 @@ "dashboard_app/report_detail.html", { "report": report, }, RequestContext(request)) + + +def data_view_list(request): + repo = DataViewRepository.get_instance() + return render_to_response( + "dashboard_app/data_view_list.html", { + "data_view_list": repo.data_views + }, RequestContext(request)) + + +def data_view_detail(request, name): + repo = DataViewRepository.get_instance() + try: + data_view = repo[name] + except KeyError: + raise Http404('No data view matches the given query.') + return render_to_response( + "dashboard_app/data_view_detail.html", { + "data_view": data_view + }, RequestContext(request))