i like this idea, and i committed a check in the foreign key init to set the type if a column has NULLTYPE for a type (which is the default if you send None). but having the parameter optional requires some positional *args games which id rather not get into right now, so it looks like:
Column('user_id', None, ForeignKey("users.user_id")) Alexandre CONRAD wrote: > Hello, > > I was wondering why not having an automatic datatype assigned to a FK > column instead of repeating twice the data type that has to be set... > > a user table would have: > > Column('user_id', Integer, primary_key=True), > > and an address table refereing to a user would have: > > Column('user_id', ForeignKey("users.user_id")), > > Here, I don't specify that the FK column is an Integer, because some > clever mechanics would do that for me. > > I suppose that this was already thougt before, but I was just wondering... > > Regards, > -- > Alexandre CONRAD --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy -~----------~----~----~----~------~----~------~--~---