Skip to content

Commit 32276c4

Browse files
author
Ryan P Kilby
committed
Added django 1.9 check to transform expansion
1 parent e6d52c1 commit 32276c4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rest_framework_filters/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
from collections import OrderedDict
33

4+
import django
45
from django.db.models.constants import LOOKUP_SEP
56
from django.db.models.expressions import Expression
67
from django.db.models.lookups import Transform
@@ -14,7 +15,7 @@ def lookups_for_field(model_field):
1415
lookups = []
1516

1617
for expr, lookup in six.iteritems(class_lookups(model_field)):
17-
if issubclass(lookup, Transform):
18+
if issubclass(lookup, Transform) and django.VERSION >= (1, 9):
1819
transform = lookup(Expression(model_field))
1920
lookups += [
2021
LOOKUP_SEP.join([expr, sub_expr]) for sub_expr

0 commit comments

Comments
 (0)