-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct payment_per_time field definition - see HEA-572
payment_per_time was defined as a PositiveSmallIntegerField, but some data contains values to large for a small integer, and it is possible that for OtherCashIncome the payment_per_time could be a non-integer. Therefore, change to a FloatField with a validator to ensure the value is positive.
- Loading branch information
Showing
4 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
apps/baseline/migrations/0018_alter_livelihoodactivity_price_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Generated by Django 5.1.1 on 2024-11-22 21:21 | ||
|
||
from django.db import migrations, models | ||
|
||
import common.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("baseline", "0017_alter_livelihoodactivity_percentage_kcals"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="livelihoodactivity", | ||
name="price", | ||
field=models.FloatField( | ||
blank=True, | ||
help_text="Price per unit", | ||
null=True, | ||
validators=[common.models.validate_positive], | ||
verbose_name="Price", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="othercashincome", | ||
name="payment_per_time", | ||
field=models.FloatField( | ||
blank=True, | ||
help_text="Amount of money received each time the labor is performed", | ||
null=True, | ||
validators=[common.models.validate_positive], | ||
verbose_name="Payment per time", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="paymentinkind", | ||
name="payment_per_time", | ||
field=models.FloatField( | ||
blank=True, | ||
help_text="Amount of item received each time the labor is performed", | ||
null=True, | ||
validators=[common.models.validate_positive], | ||
verbose_name="Payment per time", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters