Folks, I have the following Class:
class User(object):
def __init__(self, name, bd, phone, address):
self.name = name
self.bd = bd
You have multiple options:
Store the user data as a dictionary and then dump in into json. It is doable, but I don't recommend it.
Use ORM (Object Relation Mapper) which bascially maps an object (such as user) into a table in the database. The defacto ORM for Python is SQLAlchemy. However, since you mention MongoDB I suggest take a look at mongokit.