=== modified file 'dashboard_app/models.py'
@@ -1029,6 +1029,21 @@
class Meta:
ordering = ['-import_assigned_date']
+ def show_device(self):
+ all_attributes = self.attributes.all()
+ for one_attributes in all_attributes:
+ if one_attributes.name == "target":
+ return one_attributes.value
+
+ for one_attributes in all_attributes:
+ if one_attributes.name == "target.hostname":
+ return one_attributes.value
+
+ for one_attributes in all_attributes:
+ if one_attributes.name == "target.device_type":
+ return one_attributes.value
+ return "Target Device"
+
class TestRunDenormalization(models.Model):
"""
=== modified file 'dashboard_app/templates/dashboard_app/_test_run_list_table.html'
@@ -14,11 +14,7 @@
<tbody>
{% for test_run in test_run_list %}
<tr>
- {% for attribute in test_run.attributes.all %}
- {% if attribute.name == "target" %}
- <td>{{ attribute.value }}</td>
- {% endif %}
- {% endfor %}
+ <td>{{ test_run.show_device }}</td>
<td><a href="{{ test_run.get_absolute_url }}"><code>{{ test_run.test }} results<code/></a></td>
<td>{{ test_run.test }}</td>
<td>{{ test_run.get_summary_results.pass }}</td>