From 50f59abc1dce340944e2ed823086c5317e984538 Mon Sep 17 00:00:00 2001 From: "Chris J. Karr" Date: Sat, 25 Mar 2017 22:05:34 +0000 Subject: [PATCH] Initial work on swapping JSONField usage on Postgres versions --- models.py | 12 ++++++++++++ requirements.txt | 17 ++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/models.py b/models.py index 9f8d7d1..f09bd39 100644 --- a/models.py +++ b/models.py @@ -1,10 +1,12 @@ from __future__ import unicode_literals import importlib +import psycopg2 from django.conf import settings from django.contrib.postgres.fields import JSONField from django.contrib.gis.db import models +from django.db import connection from django.db.models.signals import post_delete from django.dispatch.dispatcher import receiver @@ -24,6 +26,16 @@ def generator_label(identifier): return identifier +_CACHED_SUPPORTS_JSON_FIELD = None + +def install_supports_jsonfield(): + if _CACHED_SUPPORTS_JSON_FIELD is not None: + return _CACHED_SUPPORTS_JSON_FIELD + + print(connection.backend_info) + + return False + class DataPoint(models.Model): source = models.CharField(max_length=1024, db_index=True) diff --git a/requirements.txt b/requirements.txt index b97d1ec..012fb6c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,13 +1,12 @@ -Django==1.10.1 +Django==1.10.6 argparse==1.2.1 -arrow==0.7.0 +arrow==0.10.0 +dj-database-url==0.4.2 +gunicorn==19.7.1 lockfile==0.12.2 -psycopg2==2.6.1 -python-dateutil==2.5.3 -pytz==2016.4 +psycopg2==2.7.1 +python-dateutil==2.6.0 +pytz==2016.10 six==1.10.0 +whitenoise==3.3.0 wsgiref==0.1.2 -xkcdpass==1.6.4 -gunicorn==19.6.0 -dj-database-url==0.4.1 -whitenoise==3.2