I have a model:
Model(models.Model)
price = models.DecimalField(max_digits=10, decimal_places=2)
and I have a string:
new_price = "39.99"
When I try the following:
model_instance.price = float(new_price)
model_instance.save()
I get django.core.exceptions.ValidationError: {'price': ['Ensure that there are no more than 10 digits in total.']}
Why?