On Tuesday, June 28, 2011 9:43:47 AM UTC-4, DenesL wrote:
>
>
> It does matter, it is flagged as a Syntax Error.
>
> Also:
> Field('tax_rate', 'decimal(5,2)', default='0.00')
> should be
> Field('tax_rate', 'decimal(5,2)', default=0.0) #a number, not a
> string
> same for
> Field('shipping_amount', 'decimal(17,2)', default='0.00')
The default validator for decimal fields is IS_DECIMAL_IN_RANGE, which does
take a string (and converts it to a Decimal object). I'm not sure what
happens if you do an insert without a form, though -- in that case, it may
be better to set the default to decimal.Decimal('0.00').
Anthony