From patchwork Mon Jan 14 03:15:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 14019 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 A2B9C24193 for ; Mon, 14 Jan 2013 03:15:19 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id DFB23A1833A for ; Mon, 14 Jan 2013 03:15:18 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id n11so3098013vch.16 for ; Sun, 13 Jan 2013 19:15:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:content-type:mime-version:x-launchpad-project :x-launchpad-branch:x-launchpad-message-rationale :x-launchpad-branch-revision-number:x-launchpad-notification-type:to :from:subject:message-id:date:reply-to:sender:errors-to:precedence :x-generated-by:x-launchpad-hash:x-gm-message-state; bh=T0gHCULHd9jS+qZjctvqTyOZlDczTFd2jB4Ny8cI46k=; b=DKjKE0TrodrofBmBzLn6sLXNUSb1jWcxNofAO/lW2D6cdu2tLwqpzNOZdyhWDG2JCH UODqKQvUzvyASrV0vvI5iXAl3d7/i4v57Tmh6cPJVFX/yUunombndaS1SQ20R4Z+Nzne sWoVZBNKtNDhSDKtt7sfgHty92yNbfnGuSDhpbul7WUIV5h9yviwLp5XNB8iHk7n0Uzf CX9BMAaDVwPMFAlr/xjc7Agxk/Ly8K6gU/CZX40c5/t/jxCxm+wBujL/c8QFHMfd8uo2 kTfSFGUjBl8eIZzXI76xA22Uhfce8QTcpVWWWLrPP+xktfdQOnA2pPkQE1M34iVFAXMw gbQA== X-Received: by 10.52.70.205 with SMTP id o13mr87906480vdu.75.1358133318350; Sun, 13 Jan 2013 19:15:18 -0800 (PST) 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.58.145.101 with SMTP id st5csp41701veb; Sun, 13 Jan 2013 19:15:17 -0800 (PST) X-Received: by 10.180.80.170 with SMTP id s10mr9872624wix.27.1358133316821; Sun, 13 Jan 2013 19:15:16 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id wo3si20514543wjc.53.2013.01.13.19.15.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Jan 2013 19:15:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1TuaW4-0002OM-6G for ; Mon, 14 Jan 2013 03:15:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 1F867E01A5 for ; Mon, 14 Jan 2013 03:15:16 +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: 388 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 388: remove useless code and clean up UI Message-Id: <20130114031516.11890.53191.launchpad@ackee.canonical.com> Date: Mon, 14 Jan 2013 03:15:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16420"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 3d072b1b04fc5af448f9956759257acf7b6e4755 X-Gm-Message-State: ALoCoQndSir6p8aXyZW8AyW9T1zIzrCFcnwh1KsS4GTLysgyMTY50o6d4KPFn2O8oD8WcWSPBbmJ Merge authors: Andy Doan (doanac) Related merge proposals: https://code.launchpad.net/~doanac/lava-dashboard/remove-bad-content/+merge/142954 proposed by: Andy Doan (doanac) review: Approve - Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 388 [merge] committer: Andy Doan branch nick: lava-dashboard timestamp: Sun 2013-01-13 21:13:50 -0600 message: remove useless code and clean up UI removed: dashboard_app/forms.py dashboard_app/templates/dashboard_app/api.html dashboard_app/templates/dashboard_app/front_page_snippet.html dashboard_app/templates/dashboard_app/test_detail.html dashboard_app/templates/dashboard_app/test_list.html dashboard_app/templates/dashboard_app/testing_effort_detail.html dashboard_app/templates/dashboard_app/testing_effort_form.html dashboard_app/templates/dashboard_app/testing_effort_list.html added: dashboard_app/migrations/0027_auto__del_testingeffort.py modified: dashboard_app/admin.py dashboard_app/extension.py dashboard_app/models.py dashboard_app/templates/dashboard_app/index.html dashboard_app/urls.py dashboard_app/views/__init__.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/admin.py' --- dashboard_app/admin.py 2013-01-09 02:57:13 +0000 +++ dashboard_app/admin.py 2013-01-11 16:25:54 +0000 @@ -47,7 +47,6 @@ TestRunFilter, TestRunFilterAttribute, TestRunFilterSubscription, - TestingEffort, ) @@ -179,10 +178,6 @@ inlines = [NamedAttributeInline] -class TestingEffortAdmin(admin.ModelAdmin): - list_display = ('__unicode__', 'project') - - class ImageAdmin(admin.ModelAdmin): save_as = True @@ -226,4 +221,3 @@ admin.site.register(TestRunFilter, TestRunFilterAdmin) admin.site.register(TestRunFilterSubscription) admin.site.register(Tag) -admin.site.register(TestingEffort, TestingEffortAdmin) === modified file 'dashboard_app/extension.py' --- dashboard_app/extension.py 2013-01-08 01:26:16 +0000 +++ dashboard_app/extension.py 2013-01-11 17:08:32 +0000 @@ -36,37 +36,29 @@ return "dashboard_app.views.index" def get_menu(self): + from django.conf import settings from django.core.urlresolvers import reverse + menu = super(DashboardExtension, self).get_menu() - menu.sub_menu = [ - Menu("About", reverse(self.main_view_name)), - Menu("Testing Efforts", reverse("dashboard_app.views.testing_effort_list")), - Menu("Bundle Streams", reverse("dashboard_app.views.bundle_stream_list")), - Menu("Tests", reverse("dashboard_app.views.test_list")), - Menu("Data Views", reverse("dashboard_app.views.data_view_list")), - Menu("Reports", reverse("dashboard_app.views.report_list")), - Menu("Image Reports", reverse("dashboard_app.views.images.image_report_list")), - Menu("Filters", reverse("dashboard_app.views.filters.views.filters_list")), - ] + subm = [] + menu.sub_menu = subm + subm.append(Menu("Image Reports", reverse("dashboard_app.views.images.image_report_list"))) + subm.append(Menu("Filters", reverse("dashboard_app.views.filters.views.filters_list"))) + subm.append(Menu("Bundle Streams", reverse("dashboard_app.views.bundle_stream_list"))) + if not settings.DATAVIEW_HIDE: + subm.append(Menu("Data Views", reverse("dashboard_app.views.data_view_list"))) + if not settings.DATAREPORTS_HIDE: + subm.append(Menu("Reports", reverse("dashboard_app.views.report_list"))) + return menu @property - def front_page_template(self): - return "dashboard_app/front_page_snippet.html" - - def get_front_page_context(self): - from dashboard_app.models import DataReport - return { - 'report_list': DataReport.repository.filter(front_page=True), - } - - @property def description(self): return "Validation Dashboard" @property def version(self): - import dashboard_app + import dashboard_app import versiontools return versiontools.format_version(dashboard_app.__version__, hint=dashboard_app) @@ -91,8 +83,12 @@ def contribute_to_settings_ex(self, settings_module, settings_object): settings_module['DATAVIEW_DIRS'] = settings_object._settings.get( "DATAVIEW_DIRS", []) + settings_module['DATAVIEW_HIDE'] = settings_object._settings.get( + "DATAVIEW_HIDE", False) settings_module['DATAREPORT_DIRS'] = settings_object._settings.get( "DATAREPORT_DIRS", []) + settings_module['DATAREPORTS_HIDE'] = settings_object._settings.get( + "DATAREPORTS_HIDE", False) # Enable constrained dataview database if requested if settings_object._settings.get("use_dataview_database"): === removed file 'dashboard_app/forms.py' --- dashboard_app/forms.py 2012-08-12 23:54:14 +0000 +++ dashboard_app/forms.py 1970-01-01 00:00:00 +0000 @@ -1,26 +0,0 @@ -from django import forms -from django.contrib.auth.models import Group -from django.core.exceptions import ValidationError -from django.utils.translation import ugettext as _ - -from lava_projects.models import Project -from dashboard_app.models import TestingEffort - - -class TestingEffortForm(forms.Form): - - name = forms.CharField( - label=_(u"Name"), - max_length=100) - - description = forms.CharField( - required=False, - widget=forms.widgets.Textarea(), - label=_(u"Description"), - help_text=_(u"Description of this testing effort")) - - tags = forms.CharField( - required=False, - label=_(u"Tags"), - max_length=1024, - help_text=_(u"Tags, separated by whitespace or commas")) === added file 'dashboard_app/migrations/0027_auto__del_testingeffort.py' --- dashboard_app/migrations/0027_auto__del_testingeffort.py 1970-01-01 00:00:00 +0000 +++ dashboard_app/migrations/0027_auto__del_testingeffort.py 2013-01-11 16:25:54 +0000 @@ -0,0 +1,269 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Deleting model 'TestingEffort' + db.delete_table('dashboard_app_testingeffort') + + # Removing M2M table for field tags on 'TestingEffort' + db.delete_table('dashboard_app_testingeffort_tags') + + + def backwards(self, orm): + # Adding model 'TestingEffort' + db.create_table('dashboard_app_testingeffort', ( + ('description', self.gf('django.db.models.fields.TextField')()), + ('project', self.gf('django.db.models.fields.related.ForeignKey')(related_name='testing_efforts', to=orm['lava_projects.Project'])), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), + )) + db.send_create_signal('dashboard_app', ['TestingEffort']) + + # Adding M2M table for field tags on 'TestingEffort' + db.create_table('dashboard_app_testingeffort_tags', ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('testingeffort', models.ForeignKey(orm['dashboard_app.testingeffort'], null=False)), + ('tag', models.ForeignKey(orm['dashboard_app.tag'], null=False)) + )) + db.create_unique('dashboard_app_testingeffort_tags', ['testingeffort_id', 'tag_id']) + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'dashboard_app.attachment': { + 'Meta': {'object_name': 'Attachment'}, + 'content': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True'}), + 'content_filename': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'public_url': ('django.db.models.fields.URLField', [], {'max_length': '512', 'blank': 'True'}) + }, + 'dashboard_app.bundle': { + 'Meta': {'ordering': "['-uploaded_on']", 'object_name': 'Bundle'}, + '_gz_content': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'db_column': "'gz_content'"}), + '_raw_content': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'db_column': "'content'"}), + 'bundle_stream': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bundles'", 'to': "orm['dashboard_app.BundleStream']"}), + 'content_filename': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'content_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'unique': 'True', 'null': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_deserialized': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'uploaded_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'uploaded_bundles'", 'null': 'True', 'to': "orm['auth.User']"}), + 'uploaded_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.utcnow'}) + }, + 'dashboard_app.bundledeserializationerror': { + 'Meta': {'object_name': 'BundleDeserializationError'}, + 'bundle': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'deserialization_error'", 'unique': 'True', 'primary_key': 'True', 'to': "orm['dashboard_app.Bundle']"}), + 'error_message': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'traceback': ('django.db.models.fields.TextField', [], {'max_length': '32768'}) + }, + 'dashboard_app.bundlestream': { + 'Meta': {'object_name': 'BundleStream'}, + 'group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.Group']", 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_anonymous': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'pathname': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + }, + 'dashboard_app.hardwaredevice': { + 'Meta': {'object_name': 'HardwareDevice'}, + 'description': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'device_type': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'dashboard_app.image': { + 'Meta': {'object_name': 'Image'}, + 'filter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'null': 'True', 'to': "orm['dashboard_app.TestRunFilter']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '1024'}) + }, + 'dashboard_app.imageset': { + 'Meta': {'object_name': 'ImageSet'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'images': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['dashboard_app.Image']", 'symmetrical': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '1024'}) + }, + 'dashboard_app.launchpadbug': { + 'Meta': {'object_name': 'LaunchpadBug'}, + 'bug_id': ('django.db.models.fields.PositiveIntegerField', [], {'unique': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'test_runs': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'launchpad_bugs'", 'symmetrical': 'False', 'to': "orm['dashboard_app.TestRun']"}) + }, + 'dashboard_app.namedattribute': { + 'Meta': {'unique_together': "(('object_id', 'name'),)", 'object_name': 'NamedAttribute'}, + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.TextField', [], {}), + 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'value': ('django.db.models.fields.TextField', [], {}) + }, + 'dashboard_app.pmqabundlestream': { + 'Meta': {'object_name': 'PMQABundleStream'}, + 'bundle_stream': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['dashboard_app.BundleStream']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + }, + 'dashboard_app.softwarepackage': { + 'Meta': {'unique_together': "(('name', 'version'),)", 'object_name': 'SoftwarePackage'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'dashboard_app.softwarepackagescratch': { + 'Meta': {'object_name': 'SoftwarePackageScratch'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'dashboard_app.softwaresource': { + 'Meta': {'object_name': 'SoftwareSource'}, + 'branch_revision': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'branch_url': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'branch_vcs': ('django.db.models.fields.CharField', [], {'max_length': '10'}), + 'commit_timestamp': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'project_name': ('django.db.models.fields.CharField', [], {'max_length': '32'}) + }, + 'dashboard_app.tag': { + 'Meta': {'object_name': 'Tag'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '256'}) + }, + 'dashboard_app.test': { + 'Meta': {'object_name': 'Test'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'blank': 'True'}), + 'test_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}) + }, + 'dashboard_app.testcase': { + 'Meta': {'unique_together': "(('test', 'test_case_id'),)", 'object_name': 'TestCase'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'test': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_cases'", 'to': "orm['dashboard_app.Test']"}), + 'test_case_id': ('django.db.models.fields.TextField', [], {}), + 'units': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'dashboard_app.testresult': { + 'Meta': {'ordering': "('_order',)", 'object_name': 'TestResult'}, + '_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lineno': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'measurement': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '20', 'decimal_places': '10', 'blank': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'microseconds': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'relative_index': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'result': ('django.db.models.fields.PositiveSmallIntegerField', [], {}), + 'test_case': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'test_results'", 'null': 'True', 'to': "orm['dashboard_app.TestCase']"}), + 'test_run': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_results'", 'to': "orm['dashboard_app.TestRun']"}), + 'timestamp': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}) + }, + 'dashboard_app.testrun': { + 'Meta': {'ordering': "['-import_assigned_date']", 'object_name': 'TestRun'}, + 'analyzer_assigned_date': ('django.db.models.fields.DateTimeField', [], {}), + 'analyzer_assigned_uuid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '36'}), + 'bundle': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_runs'", 'to': "orm['dashboard_app.Bundle']"}), + 'devices': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'test_runs'", 'blank': 'True', 'to': "orm['dashboard_app.HardwareDevice']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'import_assigned_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'microseconds': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'packages': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'test_runs'", 'blank': 'True', 'to': "orm['dashboard_app.SoftwarePackage']"}), + 'sources': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'test_runs'", 'blank': 'True', 'to': "orm['dashboard_app.SoftwareSource']"}), + 'sw_image_desc': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'test_runs'", 'blank': 'True', 'to': "orm['dashboard_app.Tag']"}), + 'test': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'test_runs'", 'to': "orm['dashboard_app.Test']"}), + 'time_check_performed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'dashboard_app.testrundenormalization': { + 'Meta': {'object_name': 'TestRunDenormalization'}, + 'count_fail': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'count_pass': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'count_skip': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'count_unknown': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'test_run': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'denormalization'", 'unique': 'True', 'primary_key': 'True', 'to': "orm['dashboard_app.TestRun']"}) + }, + 'dashboard_app.testrunfilter': { + 'Meta': {'unique_together': "(('owner', 'name'),)", 'object_name': 'TestRunFilter'}, + 'build_number_attribute': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'bundle_streams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['dashboard_app.BundleStream']", 'symmetrical': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.SlugField', [], {'max_length': '1024'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), + 'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'uploaded_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'to': "orm['auth.User']"}) + }, + 'dashboard_app.testrunfilterattribute': { + 'Meta': {'object_name': 'TestRunFilterAttribute'}, + 'filter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['dashboard_app.TestRunFilter']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '1024'}) + }, + 'dashboard_app.testrunfiltersubscription': { + 'Meta': {'unique_together': "(('user', 'filter'),)", 'object_name': 'TestRunFilterSubscription'}, + 'filter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['dashboard_app.TestRunFilter']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + }, + 'dashboard_app.testrunfiltertest': { + 'Meta': {'object_name': 'TestRunFilterTest'}, + 'filter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tests'", 'to': "orm['dashboard_app.TestRunFilter']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'test': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['dashboard_app.Test']"}) + }, + 'dashboard_app.testrunfiltertestcase': { + 'Meta': {'object_name': 'TestRunFilterTestCase'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'test': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'cases'", 'to': "orm['dashboard_app.TestRunFilterTest']"}), + 'test_case': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'+'", 'to': "orm['dashboard_app.TestCase']"}) + } + } + + complete_apps = ['dashboard_app'] \ No newline at end of file === modified file 'dashboard_app/models.py' --- dashboard_app/models.py 2013-01-13 21:34:23 +0000 +++ dashboard_app/models.py 2013-01-14 03:13:50 +0000 @@ -51,7 +51,6 @@ from django.utils.translation import ungettext from django_restricted_resource.models import RestrictedResource -from lava_projects.models import Project from linaro_dashboard_bundle.io import DocumentIO from dashboard_app.helpers import BundleDeserializer @@ -1374,14 +1373,12 @@ return Template(self._get_raw_html()) def _get_html_template_context(self): - from django.conf import settings return Context({ "API_URL": reverse("dashboard_app.views.dashboard_xml_rpc_handler"), "STATIC_URL": settings.STATIC_URL }) def get_html(self): - from django.conf import settings DEBUG = getattr(settings, "DEBUG", False) if self._html is None or DEBUG is True: template = self._get_html_template() @@ -1428,42 +1425,6 @@ return self.name -class TestingEffort(models.Model): - """ - A collaborative effort to test something. - - Uses tags to associate with test runs. - """ - project = models.ForeignKey( - Project, - related_name="testing_efforts") - - name = models.CharField( - verbose_name=_(u"Name"), - max_length=100) - - description = models.TextField( - verbose_name=_(u"Description"), - help_text=_(u"Description of this testing effort")) - - tags = models.ManyToManyField( - Tag, - verbose_name=_(u"Tags"), - related_name="testing_efforts") - - def __unicode__(self): - return self.name - - @models.permalink - def get_absolute_url(self): - return ("dashboard_app.views.testing_effort_detail", [self.pk]) - - def get_test_runs(self): - return TestRun.objects.order_by( - ).filter( - tags__in=self.tags.all()) - - class Image(models.Model): name = models.SlugField(max_length=1024, unique=True) === removed file 'dashboard_app/templates/dashboard_app/api.html' --- dashboard_app/templates/dashboard_app/api.html 2011-07-13 12:29:53 +0000 +++ dashboard_app/templates/dashboard_app/api.html 1970-01-01 00:00:00 +0000 @@ -1,30 +0,0 @@ -{% extends "dashboard_app/_content.html" %} -{% load markup %} -{% load i18n %} - - -{% block title %} -{{ block.super }} | {% trans "Dashboard" %} | {% trans "API Help (deprecated)" %} -{% endblock %} - - -{% block extrahead %} -{{ block.super }} - - - -{% endblock %} - - -{% block breadcrumbs %} -
  • {% trans "Dashboard" %}
  • -
  • {% trans "API Help (deprecated)" %}
  • -{% endblock %} - - -{% block content %} -

    Depracation notice

    -

    Dashboard has a separate, deprecated, XML-RPC handler. You should refrain -from using it. Instead please see the LAVA Server API Help which provides API services to all services

    -{% endblock %} === removed file 'dashboard_app/templates/dashboard_app/front_page_snippet.html' --- dashboard_app/templates/dashboard_app/front_page_snippet.html 2011-10-13 14:40:48 +0000 +++ dashboard_app/templates/dashboard_app/front_page_snippet.html 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ - - - - -{% include "dashboard_app/_extrahead.html" %} - -{% for report in report_list %} -

    {{ report }}

    -{{ report.get_html|safe }} -{% empty %} -

    Currently no reports are configured for -display on the front page

    -{% endfor %} === modified file 'dashboard_app/templates/dashboard_app/index.html' --- dashboard_app/templates/dashboard_app/index.html 2011-07-22 01:09:09 +0000 +++ dashboard_app/templates/dashboard_app/index.html 2013-01-11 16:58:08 +0000 @@ -6,53 +6,30 @@

    The Validation Dashboard is your window to test results, regardless of how your run your tests you can upload the results here and analyze them with simple -built-in reports as well as arbitrary custom reports and -data mining queries.

    - -

    Key Features

    -
      -
    • Online repository of test results, with simple to use, web APIs and - command line tools for uploading test results.
    • -
    • Test results are packaged in documents (bundles) that you can easily sync - across systems, model is similar to the one used by git
    • -
    • Test results can refer to software and hardware context so that you know - exactly what software and hardware combination fails
    • -
    • Data mining and reporting allows users to create custom tailored reports - based on the data in the system
    • -
    • Distributed work-flow model, with some data privacy out of the box, fully - private installation can be deployed in minutes.
    • -
    - -

    Documentation & Get Started

    -

    To get started quickly follow the link below, if you feel that an important -content is missing please report a bug or ask a question. Please make sure to report dashboard version (you are -currently using version {{lava.extensions.as_mapping.dashboard_app.version}})

    -

    All documentation is hosted on ReadTheDocs.org.

    - -

    Developers

    -
      -
    • How to put test results of my test suite into the Dashboard?
    • -
    • How to integrate my testing toolkit with the Dashboard?
    • -
    • How to allow users of my application to send anonymous qualitative and - quantitative (tests and benchmarks) data from their systems?
    • -
    - -

    Managers

    -
      -
    • What kind of reporting features are available out of the box?
    • -
    • How to create additional reports?
    • -
    • What kind of data is available in the system
    • -
    - -

    System Administrators

    -
      -
    • System requirements
    • -
    • How to deploy or upgrade the dashboard?
    • -
    • How to backup and restore the data
    • -
    +built-in views. Additionally, you can export data view +the XML-RPC API +to build your own customized reports.

    + +

    Getting Started

    + +

    The dashboard stores results of tests in bundles. These +bundles are then grouped by a thing called bundle streams. +You can drill down by viewing the +bundle stream list. +However, that view can present too much data.

    + +

    There are two good ways to limit the data in order to see the +results you are interested in

    + +

    Filters

    +

    Filters +allow you to create your own list of criteria for what you'd like to look at. +These can be created as "public" so others can use them, or private so only +you can see them.

    + +

    Image Reports

    +

    Image Reports +are a feature built on top of filters, that allow a nice view of daily jobs +that are being run in LAVA.

    + {% endblock %} === removed file 'dashboard_app/templates/dashboard_app/test_detail.html' --- dashboard_app/templates/dashboard_app/test_detail.html 2011-07-12 02:34:12 +0000 +++ dashboard_app/templates/dashboard_app/test_detail.html 1970-01-01 00:00:00 +0000 @@ -1,46 +0,0 @@ -{% extends "dashboard_app/_content.html" %} -{% load i18n %} - - -{% block content %} - - - - - - - - - - - - - {% for test_case in test.test_cases.all %} - - - - - - - - {% endfor %} - {% if test.count_results_without_test_case %} - - - - - - - - {% endif %} - -
    IDNameUnitsTotal ResultsTotal Failures
    {{ test_case.test_case_id }}{{ test_case.name|default:"not set" }}{{ test_case.units|default:"not set" }}{{ test_case.test_results.all.count }}{{ test_case.count_failures }}
    Results without test caseN/AN/A{{ test.count_results_without_test_case }}{{ test.count_failures_without_test_case }}
    -{% endblock %} === removed file 'dashboard_app/templates/dashboard_app/test_list.html' --- dashboard_app/templates/dashboard_app/test_list.html 2011-07-12 02:34:12 +0000 +++ dashboard_app/templates/dashboard_app/test_list.html 1970-01-01 00:00:00 +0000 @@ -1,34 +0,0 @@ -{% extends "dashboard_app/_content.html" %} -{% load i18n %} - - -{% block content %} - - - - - - - - - - - - {% for test in test_list %} - - - - - - - {% endfor %} - -
    IDNameTest CasesTest Runs
    {{ test.test_id }}{{ test.name|default:"not set" }}{{ test.test_cases.all.count }}{{ test.test_runs.all.count }}
    -{% endblock %} === removed file 'dashboard_app/templates/dashboard_app/testing_effort_detail.html' --- dashboard_app/templates/dashboard_app/testing_effort_detail.html 2011-10-06 12:03:00 +0000 +++ dashboard_app/templates/dashboard_app/testing_effort_detail.html 1970-01-01 00:00:00 +0000 @@ -1,118 +0,0 @@ -{% extends "dashboard_app/_content_with_sidebar.html" %} -{% load humanize %} -{% load markup %} -{% load i18n %} - - -{% block extrahead %} -{{ block.super }} - - - - -{% endblock %} - - -{% block sidebar %} -

    Administration

    -{% if belongs_to_user %} - -{% else %} -

    You cannot make any changes to this testing effort. Only the owner of the -{{ effort.project }} can do -this.

    -{% endif %} - -

    Tags

    -

    The concept of testing efforts is based on using -tags to associate test runs with a common goal or task. This testing effort -will list any test runs that have any of the following tags -present.

    -
      - {% for tag in effort.tags.all %} -
    • {{ tag }}
    • - {% empty %} - This testing effort has not defined any tags yet, tests - runs will not show up unless this is done - {% endfor %} -
    -{% endblock %} - - -{% block content %} - -

    About {{ effort.name }}

    -{{ effort.description|markdown }} -

    Tests related to this effort

    -

    The following tests contain one of the tags associated with this effort

    - - {% regroup test_run_list|dictsortreversed:"analyzer_assigned_date" by analyzer_assigned_date|date:"Y-m-d" as test_run_cluster_list %} - {% for test_run_cluster in test_run_cluster_list %} - - - - - - - - {% for test_run in test_run_cluster.list %} - - - {% with test_run.denormalization as denormalization %} - - - - - - {% endwith %} - - {% endfor %} - {% endfor %} -
    Tests ran on {{ test_run_cluster.grouper }}PassFailSkipUnknown
    {{ test_run.test }} - {% spaceless %} -
    -
    -
    -
    - {% endspaceless %} -
    {{ denormalization.count_pass }}{{ denormalization.count_fail }}{{ denormalization.count_skip }}{{ denormalization.count_unknown }}
    -{% endblock %} === removed file 'dashboard_app/templates/dashboard_app/testing_effort_form.html' --- dashboard_app/templates/dashboard_app/testing_effort_form.html 2011-10-06 12:03:00 +0000 +++ dashboard_app/templates/dashboard_app/testing_effort_form.html 1970-01-01 00:00:00 +0000 @@ -1,61 +0,0 @@ -{% extends "dashboard_app/_content_with_sidebar.html" %} -{% comment %} -This template is a candidate for lava-server/form.html (generic form template) -To make it work sensibly we need to move javascript and theme code to widgets -and start using proper widget media references -{% endcomment %} -{% load humanize %} -{% load markup %} -{% load i18n %} - - -{% block extrahead %} -{{ block.super }} - - - - -{% endblock %} - - -{% block content %} - -
    - {% block form_header %} - {% endblock %} - {% csrf_token %} - - {% for field in form %} - {% block form_field %} - - - - - {% endblock %} - {% endfor %} -
    - {% if field.errors %} -
    - {{ field.errors }} - {{ field }} -
    - {% else %} - {{ field }} - {% endif %} -

    {{ field.help_text }}

    -
    - {% block form_footer %} -

    Continue

    - - {% endblock %} -
    - -{% endblock %} === removed file 'dashboard_app/templates/dashboard_app/testing_effort_list.html' --- dashboard_app/templates/dashboard_app/testing_effort_list.html 2011-09-28 00:35:41 +0000 +++ dashboard_app/templates/dashboard_app/testing_effort_list.html 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -{% extends "dashboard_app/_content.html" %} -{% load humanize %} -{% load markup %} -{% load i18n %} - - -{% block content %} -

    Testing efforts

    -{% regroup effort_list by project as effort_group_list %} -{% for effort_group in effort_group_list %} -

    In project {{ effort_group.grouper }}

    -
    - {% for effort in effort_group.list %} -
    {{ effort }}
    -
    {{ effort.description|markdown }}
    - {% endfor %} -
    -{% endfor %} -{% endblock %} === modified file 'dashboard_app/urls.py' --- dashboard_app/urls.py 2013-01-11 02:26:37 +0000 +++ dashboard_app/urls.py 2013-01-11 17:07:32 +0000 @@ -21,9 +21,6 @@ """ from django.conf.urls.defaults import * -from dashboard_app.xmlrpc import legacy_mapper -import linaro_django_xmlrpc.views - urlpatterns = patterns( 'dashboard_app.views', url(r'^$', 'index'), @@ -32,8 +29,6 @@ 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'), - url(r'^tests/$', 'test_list'), - url(r'^tests/(?P[^/]+)/$', 'test_detail'), url(r'^filters/$', 'filters.views.filters_list'), url(r'^filters/\+add$', 'filters.views.filter_add'), url(r'^filters/\+add-preview-json$', 'filters.views.filter_preview_json'), @@ -46,16 +41,6 @@ url(r'^filters/~(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)/\+subscribe$', 'filters.views.filter_subscribe'), url(r'^filters/~(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)/\+delete$', 'filters.views.filter_delete'), url(r'^filters/~(?P[a-zA-Z0-9-_]+)/(?P[a-zA-Z0-9-_]+)/\+compare/(?P[a-zA-Z0-9-_: .]+)/(?P[a-zA-Z0-9-_: .]+)$', 'filters.views.compare_matches'), - url(r'^xml-rpc/$', linaro_django_xmlrpc.views.handler, - name='dashboard_app.views.dashboard_xml_rpc_handler', - kwargs={ - 'mapper': legacy_mapper, - 'help_view': 'dashboard_app.views.dashboard_xml_rpc_help'}), - url(r'^xml-rpc/help/$', linaro_django_xmlrpc.views.help, - name='dashboard_app.views.dashboard_xml_rpc_help', - kwargs={ - 'mapper': legacy_mapper, - 'template_name': 'dashboard_app/api.html'}), url(r'^streams/$', 'bundle_stream_list'), url(r'^streams/json$', 'bundle_stream_list_json'), url(r'^streams(?P/[a-zA-Z0-9/._-]+)bundles/$', 'bundle_list'), @@ -77,10 +62,6 @@ url(r'^permalink/test-result/(?P[a-zA-Z0-9-]+)/(?P[0-9]+)/(?P.*)$', 'redirect_to_test_result'), url(r'^permalink/bundle/(?P[0-9a-z]+)/$', 'redirect_to_bundle'), url(r'^permalink/bundle/(?P[0-9a-z]+)/(?P.*)$', 'redirect_to_bundle'), - url(r'^efforts/$', 'testing_effort_list'), - url(r'^efforts/(?P[0-9]+)/$', 'testing_effort_detail'), - url(r'^efforts/(?P[0-9]+)/update/$', 'testing_effort_update'), - url(r'^efforts/(?P[a-z0-9-]+)/\+new/$', 'testing_effort_create'), url(r'^image-reports/$', 'images.image_report_list'), url(r'^pmqa$', 'pmqa.pmqa_view'), url(r'^pmqa(?P/[a-zA-Z0-9/._-]+/)(?P[a-zA-Z0-9-_]+)$', 'pmqa.pmqa_filter_view'), === modified file 'dashboard_app/views/__init__.py' --- dashboard_app/views/__init__.py 2013-01-08 01:27:34 +0000 +++ dashboard_app/views/__init__.py 2013-01-11 16:25:54 +0000 @@ -60,7 +60,6 @@ Test, TestResult, TestRun, - TestingEffort, ) @@ -639,32 +638,6 @@ }, RequestContext(request)) -@BreadCrumb("Tests", parent=index) -def test_list(request): - return object_list( - request, - queryset=Test.objects.all(), - template_name="dashboard_app/test_list.html", - template_object_name="test", - extra_context={ - 'bread_crumb_trail': BreadCrumbTrail.leading_to(test_list) - }) - - -@BreadCrumb("Details of {test_id}", parent=test_list, needs=['test_id']) -def test_detail(request, test_id): - return object_detail( - request, - queryset=Test.objects.all(), - slug=test_id, - slug_field="test_id", - template_name="dashboard_app/test_detail.html", - template_object_name="test", - extra_context={ - 'bread_crumb_trail': BreadCrumbTrail.leading_to(test_detail, test_id=test_id) - }) - - def redirect_to(request, object, trailing): url = object.get_absolute_url() + trailing qs = request.META.get('QUERY_STRING') @@ -700,128 +673,3 @@ request.user, content_sha1=content_sha1) return redirect_to(request, bundle, trailing) - - -@BreadCrumb("Testing efforts", parent=index) -def testing_effort_list(request): - return render_to_response( - "dashboard_app/testing_effort_list.html", { - 'effort_list': TestingEffort.objects.all( - ).order_by('name'), - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - testing_effort_list), - }, RequestContext(request)) - - -@BreadCrumb( - "{effort}", - parent=testing_effort_list, - needs=["pk"]) -def testing_effort_detail(request, pk): - effort = get_object_or_404(TestingEffort, pk=pk) - return render_to_response( - "dashboard_app/testing_effort_detail.html", { - 'effort': effort, - 'belongs_to_user': effort.project.is_owned_by(request.user), - 'test_run_list': effort.get_test_runs( - ).select_related( - 'denormalization', - 'bundle', - 'bundle__bundle_stream', - 'test', - ), - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - testing_effort_detail, - effort=effort, - pk=pk), - }, RequestContext(request)) - - -from lava_projects.models import Project -from lava_projects.views import project_detail -from dashboard_app.forms import TestingEffortForm - - -@BreadCrumb( - "Start a new test effort", - parent=project_detail, - needs=["project_identifier"]) -@login_required -def testing_effort_create(request, project_identifier): - project = get_object_or_404(Project, identifier=project_identifier) - if request.method == 'POST': - form = TestingEffortForm(request.POST) - # Check the form - if form.is_valid(): - # And make a project instance - effort = TestingEffort.objects.create( - name=form.cleaned_data['name'], - description=form.cleaned_data['description'], - project=project) - # Create all the required tags - effort.tags = [ - Tag.objects.get_or_create(name=tag_name)[0] - for tag_name in re.split("[, ]+", form.cleaned_data["tags"]) - if tag_name != ""] - return HttpResponseRedirect(effort.get_absolute_url()) - else: - form = TestingEffortForm() - # Render to template - template_name = "dashboard_app/testing_effort_form.html" - t = loader.get_template(template_name) - c = RequestContext(request, { - 'form': form, - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - testing_effort_create, - project=project, - project_identifier=project.identifier) - }) - return HttpResponse(t.render(c)) - - -@BreadCrumb( - "Update", - parent=testing_effort_detail, - needs=["pk"]) -@login_required -def testing_effort_update(request, pk): - try: - effort = TestingEffort.objects.get(pk=pk) - except TestingEffort.DoesNotExist: - raise Http404() - if not effort.project.is_owned_by(request.user): - return HttpResponse("not allowed") - if request.method == 'POST': - form = TestingEffortForm(request.POST) - # Check the form - if form.is_valid(): - # And update the effort object - effort.name=form.cleaned_data['name'] - effort.description=form.cleaned_data['description'] - # As well as tags - effort.tags = [ - Tag.objects.get_or_create(name=tag_name)[0] - for tag_name in re.split("[, ]+", form.cleaned_data["tags"]) - if tag_name != ""] - # Save the changes - effort.save() - return HttpResponseRedirect(effort.get_absolute_url()) - else: - form = TestingEffortForm(initial={ - 'name': effort.name, - 'description': effort.description, - 'tags': " ".join([tag.name for tag in effort.tags.order_by('name').all()]) - }) - # Render to template - template_name = "dashboard_app/testing_effort_form.html" - t = loader.get_template(template_name) - c = RequestContext(request, { - 'form': form, - 'effort': effort, - 'bread_crumb_trail': BreadCrumbTrail.leading_to( - testing_effort_update, - effort=effort, - pk=effort.pk) - }) - return HttpResponse(t.render(c)) -