From patchwork Tue Oct 11 04:19:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 4603 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 1DD1A23DEF for ; Tue, 11 Oct 2011 04:19:17 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id EC63CA182C1 for ; Tue, 11 Oct 2011 04:19:16 +0000 (UTC) Received: by bke5 with SMTP id 5so11898067bke.11 for ; Mon, 10 Oct 2011 21:19:16 -0700 (PDT) Received: by 10.223.92.144 with SMTP id r16mr36929243fam.23.1318306756600; Mon, 10 Oct 2011 21:19:16 -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.152.24.41 with SMTP id r9cs143802laf; Mon, 10 Oct 2011 21:19:16 -0700 (PDT) Received: by 10.216.160.75 with SMTP id t53mr222082wek.29.1318306755831; Mon, 10 Oct 2011 21:19:15 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id w2si15184565weq.106.2011.10.10.21.19.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Oct 2011 21:19:15 -0700 (PDT) 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 1RDToB-0002bN-8u for ; Tue, 11 Oct 2011 04:19:15 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 33F83E04EB for ; Tue, 11 Oct 2011 04:19:15 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 82 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 82: Add job descriptions in the scheduler UI Message-Id: <20111011041915.20018.65699.launchpad@ackee.canonical.com> Date: Tue, 11 Oct 2011 04:19:15 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14123"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: dbbc312c135c89b8598ea6263672e0981b65ee4a Merge authors: Paul Larson (pwlars) Related merge proposals: https://code.launchpad.net/~pwlars/lava-scheduler/include-job-description/+merge/78343 proposed by: Paul Larson (pwlars) review: Approve - Michael Hudson-Doyle (mwhudson) review: Resubmit - Paul Larson (pwlars) ------------------------------------------------------------ revno: 82 [merge] committer: Paul Larson branch nick: lava-scheduler timestamp: Mon 2011-10-10 23:17:40 -0500 message: Add job descriptions in the scheduler UI added: lava_scheduler_app/migrations/0009_auto__add_field_testjob_description.py modified: lava_scheduler_app/models.py lava_scheduler_app/templates/lava_scheduler_app/alljobs.html lava_scheduler_app/templates/lava_scheduler_app/index.html lava_scheduler_app/templates/lava_scheduler_app/job.html --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === added file 'lava_scheduler_app/migrations/0009_auto__add_field_testjob_description.py' --- lava_scheduler_app/migrations/0009_auto__add_field_testjob_description.py 1970-01-01 00:00:00 +0000 +++ lava_scheduler_app/migrations/0009_auto__add_field_testjob_description.py 2011-10-01 03:27:42 +0000 @@ -0,0 +1,87 @@ +# encoding: 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): + + # Adding field 'TestJob.description' + db.add_column('lava_scheduler_app_testjob', 'description', self.gf('django.db.models.fields.CharField')(default='', max_length=200), keep_default=False) + + + def backwards(self, orm): + + # Deleting field 'TestJob.description' + db.delete_column('lava_scheduler_app_testjob', 'description') + + + 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'}) + }, + 'lava_scheduler_app.device': { + 'Meta': {'object_name': 'Device'}, + 'current_job': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lava_scheduler_app.TestJob']", 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'device_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lava_scheduler_app.DeviceType']"}), + 'hostname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'primary_key': 'True'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '1'}) + }, + 'lava_scheduler_app.devicetype': { + 'Meta': {'object_name': 'DeviceType'}, + 'name': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'primary_key': 'True', 'db_index': 'True'}) + }, + 'lava_scheduler_app.testjob': { + 'Meta': {'object_name': 'TestJob'}, + 'actual_device': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'+'", 'null': 'True', 'blank': 'True', 'to': "orm['lava_scheduler_app.Device']"}), + 'definition': ('django.db.models.fields.TextField', [], {}), + 'description': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '200'}), + 'end_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'log_file': ('django.db.models.fields.files.FileField', [], {'default': 'None', 'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'requested_device': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'+'", 'null': 'True', 'blank': 'True', 'to': "orm['lava_scheduler_app.Device']"}), + 'requested_device_type': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'+'", 'null': 'True', 'blank': 'True', 'to': "orm['lava_scheduler_app.DeviceType']"}), + 'results_link': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '400', 'null': 'True', 'blank': 'True'}), + 'start_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'submit_time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'submitter': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}) + } + } + + complete_apps = ['lava_scheduler_app'] === modified file 'lava_scheduler_app/models.py' --- lava_scheduler_app/models.py 2011-08-22 03:08:56 +0000 +++ lava_scheduler_app/models.py 2011-10-06 03:06:09 +0000 @@ -103,10 +103,13 @@ verbose_name = _(u"Submitter"), ) - #description = models.CharField( - # verbose_name = _(u"Description"), - # max_length = 200 - #) + description = models.CharField( + verbose_name = _(u"Description"), + max_length = 200, + null = True, + blank = True, + default = None + ) # Only one of these two should be non-null. requested_device = models.ForeignKey( @@ -171,9 +174,10 @@ else: target = None device_type = DeviceType.objects.get(name=job_data['device_type']) + job_name = job_data.get('job_name', '') job = TestJob( definition=json_data, submitter=user, requested_device=target, - requested_device_type=device_type) + requested_device_type=device_type, description=job_name) job.save() return job === modified file 'lava_scheduler_app/templates/lava_scheduler_app/alljobs.html' --- lava_scheduler_app/templates/lava_scheduler_app/alljobs.html 2011-10-04 22:58:15 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/alljobs.html 2011-10-11 04:17:40 +0000 @@ -15,6 +15,7 @@ ID Status Device + Description Submitter Submit Time @@ -33,6 +34,7 @@ {% else %} {{ job.requested_device_type|default:'' }} {% endif %}{% endif %} + {{ job.description|default:'' }} {{ job.submitter }} {{ job.submit_time }} === modified file 'lava_scheduler_app/templates/lava_scheduler_app/index.html' --- lava_scheduler_app/templates/lava_scheduler_app/index.html 2011-10-04 22:58:15 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/index.html 2011-10-11 04:17:40 +0000 @@ -34,6 +34,7 @@ ID Status Device + Description Submitter Submit Time @@ -52,6 +53,7 @@ {% else %} {{ job.requested_device_type|default:'' }} {% endif %}{% endif %} + {{ job.description|default:'' }} {{ job.submitter }} {{ job.submit_time }} === modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html' --- lava_scheduler_app/templates/lava_scheduler_app/job.html 2011-08-19 03:24:11 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/job.html 2011-10-06 03:06:09 +0000 @@ -8,6 +8,7 @@ float: left; padding-right: 2em; padding-bottom: 1em; + width: 20%; } #tab-output pre { margin: 0; @@ -43,6 +44,11 @@
Requested type:
{{ job.requested_device_type }}
{% endif %} + + {% if job.description %} +
Description:
+
{{ job.description }}
+ {% endif %}