Skip to content

Commit

Permalink
change field to DecimalField
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLechemia committed Feb 28, 2024
1 parent 9b4aec4 commit ec60c09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions geotrek/tourism/migrations/0050_touristicevent_price.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.23 on 2023-12-13 12:42
# Generated by Django 3.2.23 on 2024-02-26 11:06

import django.core.validators
from django.db import migrations, models
Expand All @@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='touristicevent',
name='price',
field=models.FloatField(blank=True, help_text='0 mean free', null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Price'),
field=models.DecimalField(blank=True, decimal_places=2, help_text='0 mean free', max_digits=8, null=True, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Price'),
),
]
4 changes: 3 additions & 1 deletion geotrek/tourism/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,11 @@ class TouristicEvent(ZoningPropertiesMixin, AddPropertyMixin, PublishableMixin,
help_text=_("In hours (1.5 = 1 h 30, 24 = 1 day, 48 = 2 days)"),
validators=[MinValueValidator(0)]
)
price = models.FloatField(
price = models.DecimalField(
null=True,
blank=True,
max_digits=8,
decimal_places=2,
verbose_name=_("Price"),
help_text=_("0 mean free"),
validators=[MinValueValidator(0)]
Expand Down

0 comments on commit ec60c09

Please sign in to comment.