On Aug 19, 2011, at 10:41 AM, Michael Bayer wrote:
> Id use a mixin so that a superclass can be generated in a data driven manner:
>
>
> MyCols = type("MyCols", (object, ), dict(("field%d" % i, Column(Integer)) for
> i in xrange(1, 10)))
>
> class MyClass(MyCols, Base):
> ...
>
> otherwise if you want to go the append_column() route, you can just tack them
> on the class, declarative will call append_column() as well as
> mapper.add_property():
>
> for name, col in ("field%d" % i, Column(Integer)) for i in xrange(1, 10)):
> setattr(MyClass, name, col)
Michael,
Thanks for the info.
Mark
--
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.