Documentation update for Column's type as None when column is a ForeignKey

Issue #381 resolved
Former user created an issue

I'd like to make a documentation update proposal about assigning None to a Column's datatype when the column is a ForeignKey. (from topic http://groups.google.com/group/sqlalchemy/browse_thread/thread/ca304be8b26355c6)

The following code is an update to the generated documentation: http://www.sqlalchemy.org/docs/docstrings.myt#docstrings_sqlalchemy.schema_Column

""" type: the TypeEngine for this column. This can be any subclass of types.AbstractType, including the database-agnostic types defined in the types module, database-specific types defined within specific database modules, or user-defined types. A type with a value of None can be specified if the column is a ForeignKey column. This will assign the same type as the referenced column, avoiding code redundancy and inconsistance if ever the referenced column's type is changed. """

Then I suppose the documentation can be changed from:

Column('user_id', Integer, ForeignKey('users.user_id')))

to

Column('user_id', None, ForeignKey('users.user_id')))

Regards, Alex Conrad

Comments (2)

  1. Log in to comment