graphene-django/graphene_django/compat.py
Lucas e0a5d1c58e
Support "contains" and "overlap" filtering (v2) (#1100)
* Fix project setup

* Support contains/overlap filters

* Add Python 2.7 support

* Adjust docstrings

* Remove unused fixtures
2021-01-18 21:39:18 -08:00

25 lines
611 B
Python

class MissingType(object):
pass
try:
# Postgres fields are only available in Django with psycopg2 installed
# and we cannot have psycopg2 on PyPy
from django.contrib.postgres.fields import (
IntegerRangeField,
ArrayField,
HStoreField,
JSONField as PGJSONField,
RangeField,
)
except ImportError:
IntegerRangeField, ArrayField, HStoreField, PGJSONField, RangeField = (
MissingType,
) * 5
try:
# JSONField is only available from Django 3.1
from django.db.models import JSONField
except ImportError:
JSONField = MissingType