From 063e6b5a3e9c75e43c93bbcf06424181dd4ad894 Mon Sep 17 00:00:00 2001 From: Maciej Tronowski Date: Fri, 20 Feb 2015 16:50:18 +0100 Subject: [PATCH] attributes tweaks --- qcg/models.py | 4 ++-- qcg/templates/qcg/jobs.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qcg/models.py b/qcg/models.py index 7205932..8c2be2d 100644 --- a/qcg/models.py +++ b/qcg/models.py @@ -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): diff --git a/qcg/templates/qcg/jobs.html b/qcg/templates/qcg/jobs.html index b599429..ef0c801 100644 --- a/qcg/templates/qcg/jobs.html +++ b/qcg/templates/qcg/jobs.html @@ -136,7 +136,7 @@ {{ task.start_time }} {{ task.finish_time }} {{ task.get_status_display }} - {{ task.hosts|join:', ' }} + {{ task.short_host_names|join:', ' }} {% endwith %} {% else %} @@ -168,7 +168,7 @@ {{ task.start_time }} {{ task.finish_time }} {{ task.get_status_display }} - {{ task.hosts|join:', ' }} + {{ task.short_host_names|join:', ' }} {% endfor %} {% endifequal %} -- 1.7.9.5