clinica = Clinica.objects()
return jsonify(clinica)
I receive this return
[
{
"_id": {
"$oid": "5cf3234012c113eb42407c18"
},
"name": "Clinica Test"
},{
"_id": {
"$oid": "kjaklsdj81374lkjsdf"
},
"name": "Clinica Test2"
},]
I'd like to receive
[
{
"_id": 5cf3234012c113eb42407c18,
"name": "Clinica Test"
},{
"_id": kjaklsdj81374lkjsdf,
"name": "Clinica Test2"
},
class Clinica(db.Document):
name = db.StringField()
I do need to do somenthing in model ? or does have a project that I can use in the object ?
Thank you for help
clinica = Clinica.objects().first() return jsonify(clinica.to_dict())
--
You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoengine-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongoengine-users/4da3da45-0436-4868-8820-1fb64edf3cc6%40googlegroups.com.
TypeError: Object of type AttributeError is not JSON serializable
To view this discussion on the web visit https://groups.google.com/d/msgid/mongoengine-users/CAD_%2BP9Eu91D36Xk9AQLLgT3SNvumxj%3DL_-Zh1RDk2zp_Pn4JoQ%40mail.gmail.com.