Skip to content

Commit 9360a7a

Browse files
committed
django 5.2 compatibility
Closes #494
1 parent 3da97da commit 9360a7a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cacheops/tree.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@
66
from django.db.models.sql import OR
77
from django.db.models.sql.datastructures import Join
88
from django.db.models.sql.query import Query, ExtraWhere
9-
from django.db.models.sql.where import NothingNode, SubqueryConstraint
9+
from django.db.models.sql.where import NothingNode
1010
from django.db.models.lookups import Lookup, Exact, In, IsNull
1111
from django.db.models.expressions import BaseExpression, Exists
1212

1313
from .conf import settings
1414
from .invalidation import serializable_fields
1515

16+
# This existed prior to Django 5.2
17+
try:
18+
from django.db.models.sql.where import SubqueryConstraint
19+
except ImportError:
20+
class SubqueryConstraint(object):
21+
pass
22+
1623

1724
def dnfs(qs):
1825
"""

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
'Framework :: Django :: 4.1',
4646
'Framework :: Django :: 4.2',
4747
'Framework :: Django :: 5.0',
48+
'Framework :: Django :: 5.2',
4849

4950
'Environment :: Web Environment',
5051
'Intended Audience :: Developers',

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ envlist =
55
py{38,39}-dj{32,40},
66
py310-dj{32,40,41},
77
py311-dj{41,42,50},
8-
py312-dj{42,50},
9-
py313-dj{42,50},
8+
py312-dj{42,50,52},
9+
py313-dj{42,50,52},
1010
pypy310-dj40
1111

1212
[gh-actions]
@@ -36,6 +36,7 @@ deps =
3636
dj41: Django>=4.1,<4.2
3737
dj42: Django>=4.2.8,<5.0
3838
dj50: Django>=5.0,<5.1
39+
dj52: Django>=5.2,<5.3
3940
djmain: git+https://github.com/django/django
4041
mysqlclient
4142
py{37,38,39,310,311,312,313}: psycopg2-binary

0 commit comments

Comments
 (0)