Re: [sqlalchemy] Declarative Field Type 'Alias'

2011-08-06 Thread Wichert Akkerman
On 08/05/2011 10:46 PM, Mark Erbaugh wrote: This is more of a Python issue than a SA issue, but I had trouble getting this to work. I did, but the code seems a little awkard to mesigh. In addition to the requirements already, I also wanted toe default value to be a class level 'constant'.

[sqlalchemy] Declarative Field Type 'Alias'

2011-08-05 Thread Mark Erbaugh
In my application, some tables have several fields that need to have the same type and default value, i.e.: field1 = Column(Integer, default=2) field2 = Column(Integer, default=2) ... Is there some way to refactor the Common(Integer, default=2), short of creating a custom column type? I could

Re: [sqlalchemy] Declarative Field Type 'Alias'

2011-08-05 Thread Michael Bayer
On Aug 5, 2011, at 1:36 PM, Mark Erbaugh wrote: In my application, some tables have several fields that need to have the same type and default value, i.e.: field1 = Column(Integer, default=2) field2 = Column(Integer, default=2) ... Is there some way to refactor the Common(Integer,

Re: [sqlalchemy] Declarative Field Type 'Alias'

2011-08-05 Thread Mark Erbaugh
On Aug 5, 2011, at 3:51 PM, Michael Bayer wrote: On Aug 5, 2011, at 1:36 PM, Mark Erbaugh wrote: In my application, some tables have several fields that need to have the same type and default value, i.e.: field1 = Column(Integer, default=2) field2 = Column(Integer, default=2) ...