Print all variables in a class? - Python
print(vars(objectName))
Output:
{'m_var1': 'val1', 'm_var2': 'val2'}
This will print all the class variables with values initialised.
Define __str__ or __repr__ methods in your Person class and print the object.
print db['han'].__dict__
Rather than using magic methods , Vars could be more preferable.
print(vars(db['han']))