[sqlalchemy] Immediate access to value of a new object's Sequence primary key column?

2013-11-06 Thread Michael Nachtigal
Hello, everyone, Let's say I have a class like this: Class Foo(...): id = Column('id', Sequence('id_seq'), primary_key=True) color = Column(...) size = Column(...) How do I instantiate one of these Foo objects without specifying an id for it (letting it come from the id_seq

Re: [sqlalchemy] Immediate access to value of a new object's Sequence primary key column?

2013-11-06 Thread Michael Bayer
flushing will populate the .id attribute. Set echo=True on your create_engine() and you’ll see this happening.If you’re not seeing it, then perhaps you’re not flushing what you think you are. Provide a fully working sample here if all else fails, we can show you how to make it work.

RE: [sqlalchemy] Immediate access to value of a new object's Sequence primary key column?

2013-11-06 Thread Michael Nachtigal
! Mike From: sqlalchemy@googlegroups.com [sqlalchemy@googlegroups.com] on behalf of Michael Bayer [mike...@zzzcomputing.com] Sent: Wednesday, November 06, 2013 4:02 PM To: sqlalchemy@googlegroups.com Subject: Re: [sqlalchemy] Immediate access to value of a new object's