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 > mixins are necessarily traversed in __mro__ order. It would be awkward > to link __mro__ to declared attribute order to the order the expressions > that work out to be Column objects go into a Table. IMO it is a lot > easier for a mixin or whatever to simply set "Column(... > sort_order=-1000)" to deal with simple aesthetic concerns such as these. >
I just mean that *within* a mixin (or table class), a set of columns defined as col1 = sa.Column(sa.Integer) @declared_attr def col2(cls): return sa.Column(sa.Integer) col3 = sa.Column(sa.Integer) @declared_attr def col4(cls): return sa.Column(sa.Integer) col5 = sa.Column(sa.Integer) would by default appear in order col1, col2, col3, col4, col5. -- 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 Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.