[sqlalchemy] Declarative Sequences

2013-06-26 Thread Mat Mathews
Apologies if I'm posting a question to this group incorrectly or with bad etiquette. I've been reading the emails from this group for a few years and now have a question myself. I am automating the creation of our models and business objects by reading a schema definition from YAML. We use

Re: [sqlalchemy] Declarative Sequences

2013-06-26 Thread Michael Bayer
On Jun 26, 2013, at 12:02 PM, Mat Mathews m...@miga.me wrote: I would like to do something like this: class User(object): id = Column(Integer, Sequence('user_id_seq', start=1), primary_key=True) This does work, and emits the CREATE SEQUENCE, but does not set the owned table

Re: [sqlalchemy] Declarative Sequences

2013-06-26 Thread Mat Mathews
Thanks for the quick reply. If I modify the name of the sequence in the test, it reproduces what I have experienced. When I check the details on the sequence in postgres, there is no table owner or column specified by the sequence 'test_user_id_seq'.. and I would expect to see both tables

Re: [sqlalchemy] Declarative Sequences

2013-06-26 Thread Michael Bayer
On Jun 26, 2013, at 1:26 PM, Mat Mathews m...@miga.me wrote: Thanks for the quick reply. If I modify the name of the sequence in the test, it reproduces what I have experienced. When I check the details on the sequence in postgres, there is no table owner or column specified by the

Re: [sqlalchemy] Declarative Sequences

2013-06-26 Thread Mat Mathews
That absolutely solves my issue. I had a serious suspicion I was missing something, and it was to look at the Column options, not just the Sequence. Thanks a ton. On Jun 26, 2013, at 7:44 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 26, 2013, at 1:26 PM, Mat Mathews