Can't use DecimalFields
thommor opened this issue · comments
Thomas Morledge commented
Having a model with a Decimal field is converted to a DecimalField
in the serializer but a DecimalField
requires max_digits
and decimal_places
to be provided, which is currently not supported.
You can provide max_digits
and decimal_places
to the field:
amount: Decimal = Field(max_digits=10, decimal_places=2)
but these values do not get propagated to the serializer field.
Also of note is that the above method has a type of ConstrainedDecimal
which does not exist in the FIELD_MAP