diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-03-09 13:24:54 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-03-09 13:24:54 -0500 |
| commit | 852e9954aaec7205e7ebaf3d0b232e1e8ff20e63 (patch) | |
| tree | eda5a78cc0f9a496c4b662885a4b5810669d6dc6 /lib/sqlalchemy/orm/interfaces.py | |
| parent | d2a256a3ad48341e013b6e7a3e911495e5b5d31a (diff) | |
| download | sqlalchemy-852e9954aaec7205e7ebaf3d0b232e1e8ff20e63.tar.gz | |
A meaningful :attr:`.QueryableAttribute.info` attribute is
added, which proxies down to the ``.info`` attribute on either
the :class:`.schema.Column` object if directly present, or
the :class:`.MapperProperty` otherwise. The full behavior
is documented and ensured by tests to remain stable.
[ticket:2675]
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
| -rw-r--r-- | lib/sqlalchemy/orm/interfaces.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py index b3f7baf0f..62cdb2710 100644 --- a/lib/sqlalchemy/orm/interfaces.py +++ b/lib/sqlalchemy/orm/interfaces.py @@ -209,6 +209,12 @@ class MapperProperty(_MappedAttribute, _InspectionAttr): .. versionadded:: 0.8 Added support for .info to all :class:`.MapperProperty` subclasses. + .. seealso:: + + :attr:`.QueryableAttribute.info` + + :attr:`.SchemaItem.info` + """ return {} @@ -390,6 +396,10 @@ class PropComparator(operators.ColumnOperators): return self.__class__(self.prop, self._parentmapper, adapter) + @util.memoized_property + def info(self): + return self.property.info + @staticmethod def any_op(a, b, **kwargs): return a.any(b, **kwargs) |
