Skip to content

Commit d8567f1

Browse files
committed
Fixed JSONField import only in Django 1.9+. Fixed #40
1 parent 9623640 commit d8567f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

graphene_django/compat.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ class MissingType(object):
2222

2323
try:
2424
# Postgres fields are only available in Django 1.8+
25-
from django.contrib.postgres.fields import ArrayField, HStoreField, JSONField, RangeField
25+
from django.contrib.postgres.fields import ArrayField, HStoreField, RangeField
2626
except ImportError:
2727
ArrayField, HStoreField, JSONField, RangeField = (MissingType, ) * 4
28+
29+
30+
try:
31+
# Postgres fields are only available in Django 1.9+
32+
from django.contrib.postgres.fields import JSONField
33+
except ImportError:
34+
JSONField = MissingType

0 commit comments

Comments
 (0)