Check out example codes for "sqlalchemy return id after insert". It will help you in understanding the concepts better.

Code Example 1

f = Foo(bar='x')
session.add(f)
session.flush()

print(f.id) # will return the obj id

Code Example 2

session.flush()  
print(f.id)

Learn ReactJs, React Native from akashmittal.com