Re: [sqlalchemy] Re: Column order with declarative base

2014-12-30 Thread Sven Teresniak
Aaah Michael, thanks! This is awesome! I tried a lot and all the time I felt that I missed exact this kind of easy answer. ;) Thanks again. Will implement this now. Sven Am Dienstag, 30. Dezember 2014 17:01:14 UTC+1 schrieb Michael Bayer: > > why don’t you set up your PrimaryKeyConstraint dire

Re: [sqlalchemy] Re: Column order with declarative base

2014-12-30 Thread Michael Bayer
why don’t you set up your PrimaryKeyConstraint directly? class AbstractPK(NameByClass): """ this table defines a frequently used composite primary key """ @declared_attr def key1(cls): return Column(ForeignKey("somekey.keypart1"), primary_key=True) @declared_attr def

Re: [sqlalchemy] Re: Column order with declarative base

2014-12-30 Thread Sven Teresniak
Am Freitag, 2. Juli 2010 02:24:05 UTC+2 schrieb Michael Bayer: > 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

[sqlalchemy] Re: Column order with declarative base and @declared_attr

2011-07-21 Thread Hans-Martin
> The order is determined by the order in which the actual Column constructor > is called, and an ordering token is applied.    When a mixin is used, the > Column is copied from the mixin, but it's likely that the ordering token is > preserved.   You'd declare them on Foo directly without using

[sqlalchemy] Re: Column order with declarative base

2010-07-02 Thread Mike Lewis
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 uno

Re: [sqlalchemy] Re: Column order with declarative base

2010-07-02 Thread Chris Withers
Michael Bayer wrote: 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: Done and pushed back to tip with the fix. cheers, Chris -- You received this message because you are subscribed to the Goog

Re: [sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Michael Bayer
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

Re: [sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Michael Bayer
On Jul 1, 2010, at 6:35 PM, Mike Lewis wrote: > >> Please provide a simple, small example of your problem :-) >> >> Also, is there a reason the order of column creation matters? >> >> Chris >> >> -- >> Simplistix - Content Management, Batch Processing & Python Consulting >> -http:

[sqlalchemy] Re: Column order with declarative base

2010-07-01 Thread Mike Lewis
> Please provide a simple, small example of your problem :-) > > Also, is there a reason the order of column creation matters? > > Chris > > -- > Simplistix - Content Management, Batch Processing & Python Consulting >             -http://www.simplistix.co.uk class Foo(object): id = Column(Integ