I am having some trouble using the function __dict__
with some object in python. What I wanted to do was to create a dictionary that showing all the attribute of all the sub-object in the original object as well. But when I called the function, rather than having the oject it self, I will get something like:
<Attribute><models.Object instance at 0x0000000002EF4288></Attribute>
I am new to python so I am not sure how things work. My objective to return the content of Object instance in the form of dictionary as well. Thank you guys in advance.
Yes, Thanks to bren for pointing out the mistake, the exact output is just this:
{'Attribute': <models.Object instance at 0x0000000002EF4288>}
the operation I did was just wrapper.__dict__
The class wrapper is:
class wrapper:
def wrapper(self, object):
self.Attribute = object
while object
contains other attributes as wells and I want to put them in one dict.