From ed5b4a6fa7acc4efab74f592a5a060e9df602245 Mon Sep 17 00:00:00 2001 From: nanoy Date: Mon, 10 Jun 2019 01:26:54 +0200 Subject: [PATCH] Change string of draft product --- gestion/models.py | 6 +++++- gestion/templates/gestion/manage.html | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gestion/models.py b/gestion/models.py index 9d70830..8cd64bf 100644 --- a/gestion/models.py +++ b/gestion/models.py @@ -98,7 +98,11 @@ class Product(models.Model): history = HistoricalRecords() def __str__(self): - return self.name + if self.draft_category == self.DRAFT_NONE: + return self.name + "(" + str(self.amount) + " €)" + else: + return self.name + " (" + str(self.amount) + " €, " + str(self.deg) + "°)" + def user_ranking(self, pk): """ diff --git a/gestion/templates/gestion/manage.html b/gestion/templates/gestion/manage.html index 931264f..80b3aa0 100644 --- a/gestion/templates/gestion/manage.html +++ b/gestion/templates/gestion/manage.html @@ -133,7 +133,7 @@ {% if forloop.counter0|divisibleby:4 %} {% endif %} - + {% if forloop.counter|divisibleby:4 %} {% endif %} @@ -148,7 +148,7 @@ {% if forloop.counter0|divisibleby:4 %} {% endif %} - + {% if forloop.counter|divisibleby:4 %} {% endif %} @@ -164,7 +164,7 @@ {% if forloop.counter0|divisibleby:4 %} {% endif %} - + {% if forloop.counter|divisibleby:4 %} {% endif %}