Skip to content

Commit

Permalink
Initial work on swapping JSONField usage on Postgres versions
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed Mar 25, 2017
1 parent 5c2dc98 commit 50f59ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 12 additions & 0 deletions 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

Expand All @@ -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)
Expand Down
17 changes: 8 additions & 9 deletions 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

0 comments on commit 50f59ab

Please sign in to comment.