I would like to serialize all objects that have the key "manager_objects" in the following dictionary. What is the easiest way to do so?
department {
id: 1,
name: 'ARC',
manager_object: <Object>
sub_department: {
id: 5,
name: 'ABC'
manager_object: <Object>
sub_department: {
id: 7,
name: 'TRW',
manager_object: <Object>
sub_department: {
id: 9,
name: 'MYT',
manager_object: <Object>
sub_deparment: {
id: 12,
name: 'NMY'
manager_object: <Object>
sub_department: {}
}
}
}
}
}
Manager
objects? Or are you keeping thesub_department
s as well to maintain the structure of the data? Or are you just wondering how to serialize a custom object (theManager
)?