From 9d0f877832c14f48a7d65f86249ccfd7c7c1cb5a Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 3 Sep 2017 23:54:36 +0200 Subject: [PATCH] Fix affichage stackw --- topologie/models.py | 2 -- topologie/templates/topologie/aff_stacks.html | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/topologie/models.py b/topologie/models.py index c28f1d4f..2ce5d609 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -60,8 +60,6 @@ class Stack(models.Model): def clean(self): if self.member_id_max < self.member_id_min: - import traceback - traceback.print_exc() raise ValidationError({'member_id_max':"L'id maximale est inférieure à l'id minimale"}) class Switch(models.Model): diff --git a/topologie/templates/topologie/aff_stacks.html b/topologie/templates/topologie/aff_stacks.html index e4ca286d..b2105114 100644 --- a/topologie/templates/topologie/aff_stacks.html +++ b/topologie/templates/topologie/aff_stacks.html @@ -28,14 +28,20 @@ with this program; if not, write to the Free Software Foundation, Inc., Stack ID Details + Membres {% for stack in stack_list %} - - {{stack.name}} - {{stack.stack_id}} - {{stack.details}} - + {% for switch in stack.switch_set.all %} + + {% if forloop.first %} + {{stack.name}} + {{stack.stack_id}} + {{stack.details}} + {% endif %} + {{switch}} + {% if forloop.first %} + @@ -48,6 +54,8 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endif %} + {% endif %} {% endfor %} + {% endfor %}