def __init__(self): DB_CON.register([UserDoc]) datastore = DB_CON[DB_NAME] col_name = UserDoc.__collection__ collection = datastore[col_name] doc = collection.UserDoc() API.__init__(self, col_name=col_name, collection=collection, doc=doc)
def __init__(self, db_name=DB_NAME): DB_CON.register([EventDoc]) datastore = DB_CON[db_name] col_name = EventDoc.__collection__ collection = datastore[col_name] doc = collection.EventDoc() API.__init__(self, db_name=db_name, col_name=col_name, collection=collection, doc=doc)
def __init__(self, idx): self.idx = idx DB_CON.register([IdDoc]) self.datastore = DB_CON[DB_NAME] self.collection = self.datastore[IdDoc.__collection__]