Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion fixture/loadable/sqlalchemy_loadable.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,13 @@ def save(self, row, column_vals):
c = self.conn.execute(stmt, params)
else:
c = stmt.execute(params)
primary_key = c.last_inserted_ids()

# In SQLAlchemy 0.8 this changed to a property with another name
if hasattr(c, "primary_key"):
primary_key = c.primary_key
else:
primary_key = c.last_inserted_ids()

if primary_key is None:
raise NotImplementedError(
"what can we do with a None primary key?")
Expand Down