summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-08-24 18:48:42 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-08-24 18:48:42 -0400
commit393b29477648e9b2db9597916a0e53602610ac44 (patch)
tree533dc7cb74b21cbd6f9ebeab89a6837c9bf30f35 /lib/sqlalchemy/orm/interfaces.py
parenta113c7b3a74f3c1b3128995a20c1760c87695cf3 (diff)
downloadsqlalchemy-393b29477648e9b2db9597916a0e53602610ac44.tar.gz
- [feature] Added support for .info dictionary argument to
column_property(), relationship(), composite(). All MapperProperty classes have an auto-creating .info dict available overall.
Diffstat (limited to 'lib/sqlalchemy/orm/interfaces.py')
-rw-r--r--lib/sqlalchemy/orm/interfaces.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/interfaces.py b/lib/sqlalchemy/orm/interfaces.py
index f41c5894e..12c38b595 100644
--- a/lib/sqlalchemy/orm/interfaces.py
+++ b/lib/sqlalchemy/orm/interfaces.py
@@ -126,6 +126,22 @@ class MapperProperty(_InspectionAttr):
def instrument_class(self, mapper): # pragma: no-coverage
raise NotImplementedError()
+ @util.memoized_property
+ def info(self):
+ """Info dictionary associated with the object, allowing user-defined
+ data to be associated with this :class:`.MapperProperty`.
+
+ The dictionary is generated when first accessed. Alternatively,
+ it can be specified as a constructor argument to the
+ :func:`.column_property`, :func:`.relationship`, or :func:`.composite`
+ functions.
+
+ .. versionadded:: 0.8 Added support for .info to all
+ :class:`.MapperProperty` subclasses.
+
+ """
+ return {}
+
_configure_started = False
_configure_finished = False