Make import / export work with ruptures. Fixes #4

This commit is contained in:
Alexis M 2019-09-27 16:16:09 +02:00
parent 2e524c92c1
commit 931cc77f11
3 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View file

@ -3,3 +3,5 @@ __pycache__
tmp/ tmp/
db/ db/
venv venv
.env
.vscode

View file

@ -178,7 +178,7 @@ class Product(Base):
img: str = "" img: str = ""
packing: int = None packing: int = None
producer: str = "" producer: str = ""
rupture: bool = False rupture: str = None
def __str__(self): def __str__(self):
out = self.name out = self.name

View file

@ -24,7 +24,7 @@
<tbody> <tbody>
{% for product in delivery.get_products_by(producer) %} {% for product in delivery.get_products_by(producer) %}
<tr> <tr>
<th class="product">{{ product }}</th> <th class="product {% if product.rupture %}rupture{% endif %}">{{ product }} {% if product.rupture %}(RUPTURE !){% endif %}
<td>{{ product.price | round(2) }} €</td> <td>{{ product.price | round(2) }} €</td>
{% if delivery.has_packing %} {% if delivery.has_packing %}
<td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td> <td class="packing">{% if product.packing %}{{ product.packing }} x {% endif %} {{ product.unit }}</td>