On Aug 18, 2011, at 6:06 PM, Mark Erbaugh wrote:
> want to create a table that has several similar fields. For example, assume
> the fields are field1, field2, ...
>
> Is there a way in the declarative class that I can do something like:
>
> for i in range(10):
> 'field%d' % i = Column( ... )
>
>
> Thanks,
> Mark
Figured it out:
after the class definition:
for i in range(10):
<class>.__table__.append_column(Column('field%d' % i, ...))
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.