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))
DeclarativeMeta.__init__(cls, name, bases, attrdict)
Base = declarative_base(metaclass=MyMeta)
class BasicModel(Base):
__tablename__ = 'basic'
id = Column(types.Integer, primary_key=True, autoincrement=True)
identifier = Column(types.String(40))
but the title Column does not seems to be included in the BasicModel
class.
Any idea what's wrong?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.