Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Mike Bayer
On 10/17/2016 11:51 AM, Seth P wrote: On Monday, October 17, 2016 at 11:24:43 AM UTC-4, Mike Bayer wrote: However, I don't see how the ordered attributes fixes anything in terms of mixins. If a mixin wants its columns at the beginning, or the end, all of that can be upended by

Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Seth P
On Monday, October 17, 2016 at 11:24:43 AM UTC-4, Mike Bayer wrote: > > However, I don't see how the ordered attributes fixes anything in terms > of mixins. If a mixin wants its columns at the beginning, or the end, > all of that can be upended by the presence of other mixins and those >

Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Mike Bayer
On 10/17/2016 08:38 AM, Seth P wrote: On Sunday, October 16, 2016 at 10:09:00 AM UTC-4, Mike Bayer wrote: The simplest way is probably to set the creation order of the column to be at the top: col = Column(...) col._creation_order = -10 Great. I will use _creation_order.

Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Mike Bayer
On 10/17/2016 09:32 AM, Seth P wrote: On a related note, is there something like after_create events for indexes and sequences? There doesn't seem to be. the indexes and sequences are generated in the context of the Table in which they are associated, so I'd just use the table level

Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Seth P
On a related note, is there something like after_create events for indexes and sequences? There doesn't seem to be. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable

Re: [sqlalchemy] Sequence schema

2016-10-17 Thread Seth P
On Sunday, October 16, 2016 at 10:09:00 AM UTC-4, Mike Bayer wrote: > > > > The simplest way is probably to set the creation order of the column to > be at the top: > > col = Column(...) > col._creation_order = -10 Great. I will use _creation_order. Thanks. By the way, in view of PEP 520

Re: [sqlalchemy] Sequence schema

2016-10-16 Thread Mike Bayer
On 10/14/2016 11:44 AM, Seth P wrote: I have a mixin of the following form class MyMixin(object): idx = sa.Column(sa.Integer, sa.Sequence('idx_seq', schema=???, optional=True), primary_key=True) ... I would like the sequence to have the same schema as the table into which MyMixin

[sqlalchemy] Sequence schema

2016-10-14 Thread Seth P
I have a mixin of the following form class MyMixin(object): idx = sa.Column(sa.Integer, sa.Sequence('idx_seq', schema=???, optional=True), primary_key=True) ... I would like the sequence to have the same schema as the table into which MyMixin will be mixed. I realize I could make idx