I am using DRF and i have a situation where I have too many database calls.
So I used `values()` for one of the serializers to reduce the number of calls.
I quote
>4. You don't always need to use serializers.
>
>For performance critical views you might consider dropping the serializers entirely and simply use .values() in your database queries. If you're using hyperlinked representations or other complex fields you might find you also need to do some post processing on the data structures before returning them in the response. REST framework is designed to make this easy.
Ok so far so good. One API i have issues with went from 800+ database queries to 16. I consider that a success.
Then, when I run my unit tests, things fail.
Why? Because the datetime format expected was wrong. So I used DRF's own JSOEncoder which fixed this issue but broke another thing.
Now unfortunately this setting applies the coercion at the serializer level. Not the encoder level.
SO if i use `JSONEncoder().default(this_is_a_decimal)` i will get back float. Not string. So I had to write my own encoder.
My question is is this something that can be improved within the DRF library? if so, I will be happy to send a PR.
I wasn't sure and I didn't want to pollute the github issues hence i posted here for advice.
Thank you