From: Maciej Tronowski Date: Fri, 20 Feb 2015 15:50:18 +0000 (+0100) Subject: attributes tweaks X-Git-Tag: v1.0~164 X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=commitdiff_plain;h=063e6b5a3e9c75e43c93bbcf06424181dd4ad894;p=qcg-portal.git attributes tweaks --- 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 %}