def many(self, method, rows): 'Save a list of row objects efficiently' if inspect.isgenerator(rows): rows = list(rows) if not rows: return table = rows[0].__class__ loadmany = getattr(table, '_' + method).many return loadmany( self.conn, [generic.adapt(self.driver, r) for r in rows])
def save(self, row): return generic.adapt(self.driver, row)._save(self.conn)
def insert(self, row): return generic.adapt(self.driver, row)._insert(self.conn)
def update(self, row): return generic.adapt(self.driver, row)._update(self.conn)
def create(self, row): return generic.adapt(self.driver, row)._create(self.conn)
def save(self, row): return generic.adapt(self.conn.uridict, row)._save(self.conn)
def update(self, row): return generic.adapt(self.conn.uridict, row)._update(self.conn)
def insert(self, row): return generic.adapt(self.conn.uridict, row)._insert(self.conn)
def create(self, row): return generic.adapt(self.conn.uridict, row)._create(self.conn)