self.cursor.execute("SELECT scope_identity() AS lastrowid")
else:
self.cursor.execute("SELECT @@identity AS lastrowid")
- row = self.cursor.fetchall()[0] # fetchall() ensures the cursor is consumed without closing it
+ # fetchall() ensures the cursor is consumed without closing it
+ row = self.cursor.fetchall()[0]
self._lastrowid = int(row[0])
if (self.isinsert or self.isupdate or self.isdelete) and self.compiled.returning:
"""
if '_decl_class_registry' in cls.__dict__:
- raise exceptions.InvalidRequestError("Class %r already has been instrumented declaratively" % cls)
+ raise exceptions.InvalidRequestError(
+ "Class %r already has been "
+ "instrumented declaratively" % cls)
cls._decl_class_registry = registry
cls.metadata = metadata
_as_declarative(cls, cls.__name__, cls.__dict__)