def save(self): if not self.is_init: return self.doc["_id"], self.doc["_rev"] = db().save(self.doc)
def load_session(self): for row in db().view("session/by_sender", include_docs=True)[self.nick, self.host]: self.doc = row.doc return True return False