diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 197: Misc fixes: make admin pages load faster, add links to job page and fix a

Message ID 20120716221014.5234.60300.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson July 16, 2012, 10:10 p.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-scheduler/miscellany/+merge/115049
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Andy Doan (doanac)
------------------------------------------------------------
revno: 197 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2012-07-17 10:08:49 +1200
message:
  Misc fixes: make admin pages load faster, add links to job page and fix a
  typo.
modified:
  lava_scheduler_app/admin.py
  lava_scheduler_app/templates/lava_scheduler_app/job_sidebar.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
diff mbox

Patch

=== modified file 'lava_scheduler_app/admin.py'
--- lava_scheduler_app/admin.py	2012-06-17 23:55:10 +0000
+++ lava_scheduler_app/admin.py	2012-07-15 23:49:56 +0000
@@ -38,9 +38,19 @@ 
 class DeviceAdmin(admin.ModelAdmin):
     actions = [online_action, offline_action, health_unknown, retire_action]
     list_filter = ['device_type', 'status']
+    raw_id_fields = ['current_job', 'last_health_report_job']
+
+
+class TestJobAdmin(admin.ModelAdmin):
+    raw_id_fields = ['_results_bundle']
+
+
+class DeviceStateTransitionAdmin(admin.ModelAdmin):
+    raw_id_fields = ['job']
+
 
 admin.site.register(Device, DeviceAdmin)
-admin.site.register(DeviceStateTransition)
+admin.site.register(DeviceStateTransition, DeviceStateTransitionAdmin)
 admin.site.register(DeviceType)
-admin.site.register(TestJob)
+admin.site.register(TestJob, TestJobAdmin)
 admin.site.register(Tag)

=== modified file 'lava_scheduler_app/templates/lava_scheduler_app/job_sidebar.html'
--- lava_scheduler_app/templates/lava_scheduler_app/job_sidebar.html	2012-01-11 22:04:22 +0000
+++ lava_scheduler_app/templates/lava_scheduler_app/job_sidebar.html	2012-07-15 23:52:54 +0000
@@ -17,7 +17,9 @@ 
 
     {% if job.requested_device %}
     <dt>Requested device:</dt>
-    <dd>{{ job.requested_device }}</dd>
+    <dd>
+      <a href="{{ job.requested_device.get_absolute_url }}">{{ job.requested_device }}</a>
+    </dd>
     {% endif %}
 
     {% if job.requested_device_type %}
@@ -45,7 +47,9 @@ 
 
     {% if job.actual_device %}
     <dt>On device:</dt>
-    <dd>{{ job.actual_device }}</dd>
+    <dd>
+      <a href="{{ job.actual_device.get_absolute_url }}">{{ job.actual_device }}</a>
+    </dd>
     {% endif %}
      <dt>Submitted at:</dt>
     <dd>{{ job.submit_time }}</dd>
@@ -67,7 +71,7 @@ 
     </li>
 {% endif %}
     <li>
-        <a href="{% url lava.scheduler.job.definition job.pk %}">Defintion</a>
+        <a href="{% url lava.scheduler.job.definition job.pk %}">Definition</a>
     </li>
     {% if job.results_link %}
     <li>