get model object id after commig sqlalchemy code example
Example 1: sqlalchemy return id after insert
f = Foo(bar='x')
session.add(f)
session.flush()
print(f.id) # will return the obj id
Example 2: sqlalchemy return id after insert
session.flush()
print(f.id)