attributes tweaks
authorMaciej Tronowski <mtro@man.poznan.pl>
Fri, 20 Feb 2015 15:50:18 +0000 (16:50 +0100)
committerMaciej Tronowski <mtro@man.poznan.pl>
Fri, 20 Feb 2015 15:50:18 +0000 (16:50 +0100)
qcg/models.py
qcg/templates/qcg/jobs.html

index 7205932..8c2be2d 100644 (file)
@@ -168,8 +168,8 @@ class Task(models.Model):
             self.reserved_time_start, self.reserved_time_finish = value
 
     @property
-    def hosts(self):
-        return {alloc.host_name for alloc in self.allocations.all()}
+    def short_host_names(self):
+        return {alloc.host_name.split('.')[0] for alloc in self.allocations.all()}
 
 
 class Allocation(models.Model):
index b599429..ef0c801 100644 (file)
                             <td>{{ task.start_time }}</td>
                             <td>{{ task.finish_time }}</td>
                             <td>{{ task.get_status_display }}</td>
-                            <td>{{ task.hosts|join:', ' }}</td>
+                            <td>{{ task.short_host_names|join:', ' }}</td>
                         </tr>
                     {% endwith %}
                 {% else %}
                             <td>{{ task.start_time }}</td>
                             <td>{{ task.finish_time }}</td>
                             <td>{{ task.get_status_display }}</td>
-                            <td>{{ task.hosts|join:', ' }}</td>
+                            <td>{{ task.short_host_names|join:', ' }}</td>
                         </tr>
                     {% endfor %}
                 {% endifequal %}