[sqlalchemy] Adding a Column dynamically using a metaclass

2010-07-23 Thread cropr
I am trying to add a Column definition using a metaclass but things aren't working as expected I am using something like the code below class MyMeta(DeclarativeMeta): def __init__(cls, name, bases, attrdict): setattr(cls, 'title', Column(types.String(80))

Re: [sqlalchemy] Adding a Column dynamically using a metaclass

2010-07-23 Thread Michael Bayer
On Jul 23, 2010, at 2:07 PM, cropr wrote: I am trying to add a Column definition using a metaclass but things aren't working as expected I am using something like the code below class MyMeta(DeclarativeMeta): def __init__(cls, name, bases, attrdict): setattr(cls, 'title',