Closed nullcode closed 9 months ago
Thanks for the PR.
I think instead of writing our own encoder class, we should just use Django provided DjangoJSONEncoder
. It will take care of encoding other objects as well such as datetime.
sure, makes sense @bhch , updated the PR.
current JSONEncoder would throw "Object of type Decimal is not JSON serializable" if you are using the libraries' ArrayField with a base_field of models.DecimalField(). This is a fix for that.
from django_jsonform.models.fields import ArrayField
example = ArrayField(models.DecimalField(decimal_places=2, max_digits=5))