initial commit

This commit is contained in:
Herculino Trotta
2024-09-26 11:00:40 -03:00
parent 830e821a17
commit 50b0c6ce01
138 changed files with 13566 additions and 46 deletions

View File

@@ -0,0 +1,18 @@
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def validate_decimal_places(value):
if abs(value.as_tuple().exponent) > 18:
raise ValidationError(
_("%(value)s has too many decimal places. Maximum is 18."),
params={"value": value},
)
def validate_non_negative(value):
if value < 0:
raise ValidationError(
_("%(value)s is not a non-negative number"),
params={"value": value},
)