From 852e9954aaec7205e7ebaf3d0b232e1e8ff20e63 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 9 Mar 2013 13:24:54 -0500 Subject: 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] --- lib/sqlalchemy/orm/interfaces.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/sqlalchemy/orm/interfaces.py') 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) -- cgit v1.2.1