json.dumps(o) converts a native python object to json
o.to_json() converts a mongoengine object such as Document to json
How do you convert a mixed object?
e.g a python dict, with mongoengine objects as its values?
Are there tools for this? Or should I create a custom JSONEncoder class?
If I do override the encoder, could I create a decoder that reconstructs also the mongoengine objects?