Reputation: 819
I'm trying to have the default value for several DecimalFields defined as 0.00
in my model class, but even when I have this:
price = models.DecimalField(max_digits=8, decimal_places=2,
default=Decimal(0.00))
I'm getting an error when processing the form:
ValidationError
[u'This value must be a decimal number.']
From the error page, I can see that the issue is that the save method gets u''
for the empty fields. How can I have 0.00 being stored?
Upvotes: 12
Views: 7185