Skip to content

Commit

Permalink
Added description for the hidden cost (optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
abecam committed Oct 19, 2023
1 parent 5211427 commit 163d131
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion thefiltershop/filtershop_main/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
@@ -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'),
),
]
1 change: 1 addition & 0 deletions thefiltershop/filtershop_main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 163d131

Please sign in to comment.