user = User ( 'name' = ' John Doe')
db.session.add (User)
db.session.flush ()
# outputs a new primary key data inserted
Print (the user.id)
# At this time the data was inserted into the database
db.session.commit ()
user = User ( 'name' = ' John Doe')
db.session.add (User)
db.session.flush ()
# outputs a new primary key data inserted
Print (the user.id)
# At this time the data was inserted into the database
db.session.commit ()