def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def is_dirty(self, dbs):
        return any(self[db].is_dirty() for db in dbs)