From 70423bb37f5355d8f04b83b2b3c1db1337e27be1 Mon Sep 17 00:00:00 2001 From: phaer Date: Sun, 19 Sep 2021 12:16:15 +0200 Subject: [PATCH] Allow specifying our_id in Table.m2m() --- sqlite_utils/db.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlite_utils/db.py b/sqlite_utils/db.py index 5995e4a..3fe5455 100644 --- a/sqlite_utils/db.py +++ b/sqlite_utils/db.py @@ -2092,10 +2092,11 @@ class Table(Queryable): lookup=None, m2m_table=None, alter=False, + our_id = None ): if isinstance(other_table, str): other_table = self.db.table(other_table, pk=pk) - our_id = self.last_pk + our_id = our_id or self.last_pk if lookup is not None: assert record_or_iterable is None, "Provide lookup= or record, not both" else: