Skip to content

Commit 3eaa77e

Browse files
committed
Skip ArrayField in exact conds
Closes #489
1 parent f470975 commit 3eaa77e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cacheops/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Defaults:
2121
CACHEOPS_SENTINEL = {}
2222
# NOTE: we don't use this fields in invalidator conditions since their values could be very long
2323
# and one should not filter by their equality anyway.
24-
CACHEOPS_SKIP_FIELDS = "FileField", "TextField", "BinaryField", "JSONField"
24+
CACHEOPS_SKIP_FIELDS = "FileField", "TextField", "BinaryField", "JSONField", "ArrayField"
2525
CACHEOPS_LONG_DISJUNCTION = 8
2626
CACHEOPS_SERIALIZER = 'pickle'
2727

tests/tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,11 +730,10 @@ def test_480(self):
730730
conditions.append(reduce(operator.or_, queries))
731731
list(queryset.filter(reduce(operator.and_, conditions)).cache())
732732

733+
@unittest.skipIf(connection.vendor != 'postgresql', "Only for PostgreSQL")
733734
def test_489(self):
734-
_ = TaggedPost.objects.create(meta={}, tags=[1, 2, 3])
735-
tags = TaggedPost.objects.cache().exclude(tags=[])
735+
TaggedPost.objects.cache().filter(tags=[]).count()
736736

737-
self.assertEqual(tags.count(), 1)
738737

739738
class RelatedTests(BaseTestCase):
740739
fixtures = ['basic']

0 commit comments

Comments
 (0)