def connect(self): 
        try:
            self.connection = pymongo.Connection(self.host, self.port)
            self.db = self.connection[self.name]
        except AutoReconnect:
            raise DatabaseException("It's not possible connect to the database")
def serialize(self, value, display=False):
        if not value:
            return ""
        return "\n  " + "\n  ".join(encode(v) for v in value if v)