From 163d13154fd9a15e23e24829825dcb82b5dc6398 Mon Sep 17 00:00:00 2001 From: Alain Date: Thu, 19 Oct 2023 21:47:41 +0200 Subject: [PATCH] Added description for the hidden cost (optional) --- thefiltershop/filtershop_main/admin.py | 2 +- ...0059_entity_description_hidden_full_cost.py | 18 ++++++++++++++++++ thefiltershop/filtershop_main/models.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 thefiltershop/filtershop_main/migrations/0059_entity_description_hidden_full_cost.py diff --git a/thefiltershop/filtershop_main/admin.py b/thefiltershop/filtershop_main/admin.py index 684c0ab..0f0cfc2 100644 --- a/thefiltershop/filtershop_main/admin.py +++ b/thefiltershop/filtershop_main/admin.py @@ -138,7 +138,7 @@ def save_related(self, request, form, formsets, change): class EntityAdmin(GeneralAdmin): fieldsets = [ ("General info", {"fields": ["name","description","headline"]}), - (None, {'fields': ['url','for_type','general_rating','vignette','hidden_full_cost','in_hall_of_shame','descriptionOfShame', 'tags']}), + (None, {'fields': ['url', 'for_type', 'general_rating', 'vignette', 'hidden_full_cost', 'description_hidden_full_cost', 'in_hall_of_shame', 'descriptionOfShame', 'tags']}), ] autocomplete_fields = ["tags"] diff --git a/thefiltershop/filtershop_main/migrations/0059_entity_description_hidden_full_cost.py b/thefiltershop/filtershop_main/migrations/0059_entity_description_hidden_full_cost.py new file mode 100644 index 0000000..21ed9b1 --- /dev/null +++ b/thefiltershop/filtershop_main/migrations/0059_entity_description_hidden_full_cost.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.1 on 2023-10-19 16:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('filtershop_main', '0058_alter_company_group_options_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='entity', + name='description_hidden_full_cost', + field=models.CharField(blank=True, max_length=300, null=True, verbose_name='You can give a custom description for the hidden full cost of this product'), + ), + ] diff --git a/thefiltershop/filtershop_main/models.py b/thefiltershop/filtershop_main/models.py index 098c8f1..b85320c 100644 --- a/thefiltershop/filtershop_main/models.py +++ b/thefiltershop/filtershop_main/models.py @@ -96,6 +96,7 @@ class Entity(BaseModel): vignette = models.ImageField(upload_to='images', null=True, blank=False) hidden_full_cost = models.IntegerField(default=0, validators=[MaxValueValidator(100), MinValueValidator(0)], verbose_name="Hidden full cost: 0 (none) to 50 (full price again (if not f2p)) to 80 (a lot more) to 100 (infinite, i.e. cannot be won whatever you spend)") + description_hidden_full_cost = models.CharField(max_length=300, null=True, blank=True, verbose_name="You can give a custom description for the hidden full cost of this product") crapometer = models.IntegerField(default=0, validators=[MaxValueValidator(100), MinValueValidator(0)]) in_hall_of_shame = models.BooleanField(default=False) descriptionOfShame = models.TextField(max_length=1000, null=True, blank=True)