diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-02 17:22:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-02 17:22:16 -0400 |
commit | e1c47d12bf871bf30a149c7fc167d5d22ddaa222 (patch) | |
tree | 94e26bd6a8d72589278548a874a7fcd54598b437 /lib/sqlalchemy/schema.py | |
parent | d057f98b8a0eb5f993bdcc7748b486fe5c31d392 (diff) | |
download | sqlalchemy-e1c47d12bf871bf30a149c7fc167d5d22ddaa222.tar.gz |
- The ORM will set the docstring of all generated descriptors
to None by default. This can be overridden using 'doc'
(or if using Sphinx, attribute docstrings work too).
- Added kw argument 'doc' to all mapper property callables
as well as Column(). Will assemble the string 'doc' as
the '__doc__' attribute on the descriptor.
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 8ffb68a4e..0e03be686 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -535,6 +535,10 @@ class Column(SchemaItem, expression.ColumnClause): Contrast this argument to ``server_default`` which creates a default generator on the database side. + :param doc: optional String that can be used by the ORM or similar + to document attributes. This attribute does not render SQL + comments (a future attribute 'comment' will achieve that). + :param key: An optional string identifier which will identify this ``Column`` object on the :class:`Table`. When a key is provided, this is the only identifier referencing the ``Column`` within the @@ -651,6 +655,7 @@ class Column(SchemaItem, expression.ColumnClause): self.index = kwargs.pop('index', None) self.unique = kwargs.pop('unique', None) self.quote = kwargs.pop('quote', None) + self.doc = kwargs.pop('doc', None) self.onupdate = kwargs.pop('onupdate', None) self.autoincrement = kwargs.pop('autoincrement', True) self.constraints = set() |