Me again (see below):
On Aug 18, 2011, at 7:01 PM, Mark Erbaugh wrote:
>
> 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, ...))
Some of the fields that I am adding this way are foreign keys to another table.
Is there a way to specify a relationship based on these foreign key fields?
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.