From 843a71be9be35cfbf74d3144c975940a0ffe451b Mon Sep 17 00:00:00 2001 From: detraz Date: Mon, 15 Oct 2018 00:49:03 +0200 Subject: [PATCH] =?UTF-8?q?Affichage=20de=20la=20r=C3=A9ference=20commerci?= =?UTF-8?q?ale=20par=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/topologie/models.py b/topologie/models.py index 79028378..cd191d7e 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -411,7 +411,10 @@ class ModelSwitch(AclMixin, RevMixin, models.Model): verbose_name_plural = _("switch models") def __str__(self): - return str(self.constructor) + ' ' + self.reference + if self.commercial_name: + return str(self.constructor) + ' ' + str(self.commercial_name) + else: + return str(self.constructor) + ' ' + self.reference class ConstructorSwitch(AclMixin, RevMixin, models.Model):