On Jul 1, 2010, at 8:24 PM, Michael Bayer wrote: > > The Column object contains a "sort key" when constructed, against a single > global value, that is used as a sort key when the Table is generated. This > is to get around the fact that the attribute dictionary of the declarative > class is unordered. > > The mixin columns should copy their "sort key" over, or it should somehow be > tailored in the declarative base so that the order of the two columns stays > relatively the same, and perhaps is also tailored to be at the same position > relative to the other columns in the ultimate table. > > I'd welcome any patches in this regard since I don't usually deal with the > "mixin" feature.
fine, how about Chris works up the unit test for it: diff -r af4bdd33564e lib/sqlalchemy/ext/declarative.py --- a/lib/sqlalchemy/ext/declarative.py Thu Jul 01 16:57:02 2010 -0400 +++ b/lib/sqlalchemy/ext/declarative.py Thu Jul 01 20:25:59 2010 -0400 @@ -673,7 +673,8 @@ if name not in dict_ and not ( '__table__' in dict_ and name in dict_['__table__'].c ): - potential_columns[name]=column_copies[obj]=obj.copy() + potential_columns[name] = column_copies[obj] = obj.copy() + column_copies[obj]._creation_order = obj._creation_order elif isinstance(obj, RelationshipProperty): raise exceptions.InvalidRequestError( "relationships are not allowed on " -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.