mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-06-13 10:03:12 +03:00
Fixed JSONField import only in Django 1.9+. Fixed #40
This commit is contained in:
parent
96236408c5
commit
d8567f1c58
|
@ -22,6 +22,13 @@ except:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Postgres fields are only available in Django 1.8+
|
# Postgres fields are only available in Django 1.8+
|
||||||
from django.contrib.postgres.fields import ArrayField, HStoreField, JSONField, RangeField
|
from django.contrib.postgres.fields import ArrayField, HStoreField, RangeField
|
||||||
except ImportError:
|
except ImportError:
|
||||||
ArrayField, HStoreField, JSONField, RangeField = (MissingType, ) * 4
|
ArrayField, HStoreField, JSONField, RangeField = (MissingType, ) * 4
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Postgres fields are only available in Django 1.9+
|
||||||
|
from django.contrib.postgres.fields import JSONField
|
||||||
|
except ImportError:
|
||||||
|
JSONField = MissingType
|
||||||
|
|
Loading…
Reference in New Issue
Block a user