Add abv and volume to Article model
This commit is contained in:
parent
3ca8b45014
commit
e533966f55
3 changed files with 44 additions and 0 deletions
|
@ -288,6 +288,8 @@ class ArticleForm(forms.ModelForm):
|
|||
"hidden",
|
||||
"price",
|
||||
"stock",
|
||||
"abv",
|
||||
"volume",
|
||||
"category",
|
||||
"box_type",
|
||||
"box_capacity",
|
||||
|
@ -301,6 +303,8 @@ class ArticleRestrictForm(ArticleForm):
|
|||
"is_sold",
|
||||
"hidden",
|
||||
"price",
|
||||
"abv",
|
||||
"volume",
|
||||
"category",
|
||||
"box_type",
|
||||
"box_capacity",
|
||||
|
|
33
kfet/migrations/0072_auto_20200515_1747.py
Normal file
33
kfet/migrations/0072_auto_20200515_1747.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 2.2.12 on 2020-05-15 15:47
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("kfet", "0071_promo_2020"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="article",
|
||||
name="abv",
|
||||
field=models.DecimalField(
|
||||
decimal_places=1,
|
||||
default=0,
|
||||
max_digits=6,
|
||||
verbose_name="Degré d'alcool (en %)",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="article",
|
||||
name="volume",
|
||||
field=models.DecimalField(
|
||||
decimal_places=1,
|
||||
default=0,
|
||||
max_digits=6,
|
||||
verbose_name="Volume d'une unité (en cL)",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -520,6 +520,13 @@ class Article(models.Model):
|
|||
"capacité du contenant", blank=True, null=True, default=None
|
||||
)
|
||||
|
||||
abv = models.DecimalField(
|
||||
_("Degré d'alcool (en %)"), max_digits=6, default=0, decimal_places=1
|
||||
)
|
||||
volume = models.DecimalField(
|
||||
_("Volume d'une unité (en cL)"), max_digits=6, default=0, decimal_places=1
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return "%s - %s" % (self.category.name, self.name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue