Loading django/contrib/postgres/fields/hstore.py +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ class KeyTransform(Transform): def as_sql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) return "%s -> '%s'" % (lhs, self.key_name), params return "(%s -> '%s')" % (lhs, self.key_name), params class KeyTransformFactory(object): Loading docs/releases/1.8.2.txt +2 −0 Original line number Diff line number Diff line Loading @@ -25,3 +25,5 @@ Bugfixes pointing to :class:`~django.db.models.UUIDField` and inheritance on models with ``UUIDField`` primary keys work correctly (:ticket:`24698`, :ticket:`24712`). * Fixed ``isnull`` lookup for ``HStoreField`` (:ticket:`24751`). tests/postgres_tests/test_hstore.py +11 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,17 @@ class TestQuerying(PostgresSQLTestCase): self.objs[:3] ) def test_key_isnull(self): obj = HStoreModel.objects.create(field={'a': None}) self.assertSequenceEqual( HStoreModel.objects.filter(field__a__isnull=True), self.objs[2:5] + [obj] ) self.assertSequenceEqual( HStoreModel.objects.filter(field__a__isnull=False), self.objs[:2] ) class TestSerialization(PostgresSQLTestCase): test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]' Loading Loading
django/contrib/postgres/fields/hstore.py +1 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,7 @@ class KeyTransform(Transform): def as_sql(self, compiler, connection): lhs, params = compiler.compile(self.lhs) return "%s -> '%s'" % (lhs, self.key_name), params return "(%s -> '%s')" % (lhs, self.key_name), params class KeyTransformFactory(object): Loading
docs/releases/1.8.2.txt +2 −0 Original line number Diff line number Diff line Loading @@ -25,3 +25,5 @@ Bugfixes pointing to :class:`~django.db.models.UUIDField` and inheritance on models with ``UUIDField`` primary keys work correctly (:ticket:`24698`, :ticket:`24712`). * Fixed ``isnull`` lookup for ``HStoreField`` (:ticket:`24751`).
tests/postgres_tests/test_hstore.py +11 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,17 @@ class TestQuerying(PostgresSQLTestCase): self.objs[:3] ) def test_key_isnull(self): obj = HStoreModel.objects.create(field={'a': None}) self.assertSequenceEqual( HStoreModel.objects.filter(field__a__isnull=True), self.objs[2:5] + [obj] ) self.assertSequenceEqual( HStoreModel.objects.filter(field__a__isnull=False), self.objs[:2] ) class TestSerialization(PostgresSQLTestCase): test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]' Loading