A
A
Arsen Abakarov2017-02-15 19:40:31
Django
Arsen Abakarov, 2017-02-15 19:40:31

Django JSONField problem with Decimal?

There is a model, there is a JSON field, I want to store Decimal as values
​​The standard serializer cannot convert Decimal, I want to use Django's serializer ...
So far, it only came to mind to inherit from JSONField, override all the necessary methods ..
Is there a prettier, more concise way not to "fence"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iegor, 2017-02-15
@iegor

Use django 1.11 or if that's not possible see the code there - https://docs.djangoproject.com/en/dev/_modules/dja...

S
sim3x, 2017-02-16
@sim3x

stackoverflow.com/questions/1960516/python-json-se...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question