summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-10-18 19:34:58 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-10-18 19:34:58 -0400
commit71e043aaae1ff9cbf0597846b4cfdf645a46ebdf (patch)
tree3232311a9131364b86a16407bf20718bc8bb7b46 /lib/sqlalchemy
parent7108605f697fc53f3b03a90ed4e9e05777d4a6cc (diff)
downloadsqlalchemy-71e043aaae1ff9cbf0597846b4cfdf645a46ebdf.tar.gz
- attempt to clarify what mutable extension does for HSTORE, [ticket:2803]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/hstore.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/hstore.py b/lib/sqlalchemy/dialects/postgresql/hstore.py
index c645e25d2..568ad6d19 100644
--- a/lib/sqlalchemy/dialects/postgresql/hstore.py
+++ b/lib/sqlalchemy/dialects/postgresql/hstore.py
@@ -144,8 +144,10 @@ class HSTORE(sqltypes.Concatenable, sqltypes.TypeEngine):
For usage with the SQLAlchemy ORM, it may be desirable to combine
the usage of :class:`.HSTORE` with :class:`.MutableDict` dictionary
now part of the :mod:`sqlalchemy.ext.mutable`
- extension. This extension will allow in-place changes to dictionary
- values to be detected by the unit of work::
+ extension. This extension will allow "in-place" changes to the
+ dictionary, e.g. addition of new keys or replacement/removal of existing
+ keys to/from the current dictionary, to produce events which will be detected
+ by the unit of work::
from sqlalchemy.ext.mutable import MutableDict
@@ -163,6 +165,11 @@ class HSTORE(sqltypes.Concatenable, sqltypes.TypeEngine):
session.commit()
+ When the :mod:`sqlalchemy.ext.mutable` extension is not used, the ORM
+ will not be alerted to any changes to the contents of an existing dictionary,
+ unless that dictionary value is re-assigned to the HSTORE-attribute itself,
+ thus generating a change event.
+
.. versionadded:: 0.8
.. seealso::