Adding none DB fields model to the django serialized JSON
This is just a work around ,I'v managed to use model_to_dict to get a dict object then manipulate it as i want then json.dumps to convert it .
Am not worried about deserialization as i can manage to do so as in the serialization but however am only doing this so i can get forward in my app , and this is a silly work around , so am not accepting it as an answer ,still waiting for the experts for some more robust solution.
My question may be silly, and I am no expert. What am trying to do is to manipulate the JSON generated by django.core.serializers.serialize .
I'v searched the web to try and find how to serialize some picked fields in my Model.
There is a an argument fields that takes an array of what I want to serialize, but what do I do if I want to add some calculated field that is not stored in the DB?
I've searched a lot with no results, maybe there is something like a method or a class I don't know of yet that may solve it?