mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-28 04:44:26 +02:00
Allow specifying our_id in Table.m2m()
This commit is contained in:
parent
d39ac10c03
commit
70423bb37f
1 changed files with 2 additions and 1 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue