Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sqlalchemy return id after insert

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

print(f.id) # will return the obj id
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sqlalchemy #return #id #insert
ADD COMMENT
Topic
Name
2+1 =