diff options
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r-- | lib/sqlalchemy/schema.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 4ce27582b..8b46dc250 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -71,6 +71,14 @@ class SchemaItem(events.SchemaEventTarget, visitors.Visitable): @util.memoized_property def info(self): + """Info dictionary associated with the object, allowing user-defined + data to be associated with this :class:`.SchemaItem`. + + The dictionary is automatically generated when first accessed. + It can also be specified in the constructor of some objects, + such as :class:`.Table` and :class:`.Column`. + + """ return {} def _get_table_key(name, schema): @@ -204,8 +212,8 @@ class Table(SchemaItem, expression.TableClause): ``Table`` object. Defaults to ``None`` which indicates all columns should be reflected. - :param info: A dictionary which defaults to ``{}``. A space to store - application specific data. This must be a dictionary. + :param info: Optional data dictionary which will be populated into the + :attr:`.SchemaItem.info` attribute of this object. :param keep_existing: When ``True``, indicates that if this Table is already present in the given :class:`.MetaData`, ignore @@ -408,11 +416,6 @@ class Table(SchemaItem, expression.TableClause): self, include_columns, exclude_columns ) - @util.memoized_property - def info(self): - """Dictionary provided for storage of additional information.""" - return {} - @property def _sorted_constraints(self): """Return the set of constraints as a list, sorted by creation order.""" @@ -797,8 +800,8 @@ class Column(SchemaItem, expression.ColumnClause): contain multiple columns, use the :class:`.Index` construct instead. - :param info: A dictionary which defaults to ``{}``. A space to store - application specific data. This must be a dictionary. + :param info: Optional data dictionary which will be populated into the + :attr:`.SchemaItem.info` attribute of this object. :param nullable: If set to the default of ``True``, indicates the column will be rendered as allowing NULL, else it's rendered as @@ -971,11 +974,6 @@ class Column(SchemaItem, expression.ColumnClause): else: return self.description - @util.memoized_property - def info(self): - """Dictionary provided for storage of additional information.""" - return {} - def references(self, column): """Return True if this Column references the given column via foreign key.""" |