Allow specifying our_id in Table.m2m()

This commit is contained in:
phaer 2021-09-19 12:16:15 +02:00
commit 70423bb37f

View file

@ -2092,10 +2092,11 @@ class Table(Queryable):
lookup=None, lookup=None,
m2m_table=None, m2m_table=None,
alter=False, alter=False,
our_id = None
): ):
if isinstance(other_table, str): if isinstance(other_table, str):
other_table = self.db.table(other_table, pk=pk) 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: if lookup is not None:
assert record_or_iterable is None, "Provide lookup= or record, not both" assert record_or_iterable is None, "Provide lookup= or record, not both"
else: else: