.. changelog::
:version: 0.8.7
+ .. change::
+ :tags: bug, postgresql
+ :versions: 0.9.5, 1.0.0
+ :tickets: 3053
+
+ Added the ``hashable=False`` flag to the PG :class:`.HSTORE` type, which
+ is needed to allow the ORM to skip over trying to "hash" an ORM-mapped
+ HSTORE column when requesting it in a mixed column/entity list.
+ Patch courtesy Gunnlaugur Þór Briem.
+
.. change::
:tags: bug, orm
:versions: 0.9.5, 1.0.0
)
self._assert_data([{r'key \"foo\"': r'value \"bar"\ xyz'}])
+ def test_orm_round_trip(self):
+ from sqlalchemy import orm
+ class Data(object):
+ def __init__(self, name, data):
+ self.name = name
+ self.data = data
+ orm.mapper(Data, self.tables.data_table)
+ s = orm.Session(testing.db)
+ d = Data(name='r1', data={"key1": "value1", "key2": "value2",
+ "key3": "value3"})
+ s.add(d)
+ eq_(
+ s.query(Data.data, Data).all(),
+ [(d.data, d)]
+ )
class _RangeTypeMixin(object):
__requires__ = 'range_types',
__dialect__ = 'postgresql+psycopg2'