6
sqlalchemy flush () và được chèn id?
Tôi muốn làm một cái gì đó như thế này: f = Foo(bar='x') session.add(f) session.flush() # do additional queries using f.id before commit() print f.id # should be not None session.commit() Nhưng f.idlà Nonekhi tôi thử nó. Làm thế nào tôi có thể làm cho nó hoạt động?
114
python
sqlalchemy