diff --git a/Makefile b/Makefile index ac700c7..715d28d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ SHELL := /bin/bash APPLICATION_NAME="Feed Gov Back" APPLICATION_VERSION=1.0 -VENV_PATH=~/Envs/feed-gov/bin # Colour coding for output COLOUR_NONE=\033[0m @@ -16,7 +15,7 @@ help: @echo -e "$(COLOUR_YELLOW)make sdist$(COLOUR_NONE) : Rebuild the last version" test: - $(VENV_PATH)/python ./runtests.py feedbackdb uktrade uktrade + python ./runtests.py feedbackdb uktrade uktrade sdist: rm dist/*.tar.gz; diff --git a/feedback/models.py b/feedback/models.py index 71b6dab..14f2cab 100644 --- a/feedback/models.py +++ b/feedback/models.py @@ -1,8 +1,8 @@ from django.db import models -from django.contrib.postgres import fields from django.conf import settings from .base import BaseFeedbackModel from .exceptions import InvalidElementOption +from django.db.models import JSONField USER_MODEL_PATH = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') @@ -161,7 +161,7 @@ class ElementType(models.Model): """ name = models.CharField(max_length=250, null=False, blank=False) key = models.CharField(max_length=30, null=False, blank=False) - options = fields.JSONField(default=dict) + options = JSONField(default=dict) class Meta: managed = MANAGED_MODELS @@ -189,7 +189,7 @@ class FormElement(BaseFeedbackModel): name = models.CharField(max_length=250, null=False, blank=False) label = models.CharField(max_length=1000, null=True, blank=True) description = models.TextField(null=True, blank=True) - options = fields.JSONField(default=dict, blank=True) + options = JSONField(default=dict, blank=True) order = models.SmallIntegerField(default=0) class Meta: @@ -320,7 +320,7 @@ class FeedbackData(BaseFeedbackModel): """ collection = models.ForeignKey(FeedbackCollection, null=False, blank=False, on_delete=models.PROTECT) element = models.ForeignKey(FormElement, null=False, blank=False, on_delete=models.PROTECT) - value = fields.JSONField(null=True, blank=True) + value = JSONField(null=True, blank=True) class Meta: managed = MANAGED_MODELS diff --git a/feedback/version.py b/feedback/version.py index 58d168b..5a6f84c 100644 --- a/feedback/version.py +++ b/feedback/version.py @@ -1 +1 @@ -__version__ = '0.4' +__version__ = '0.5' diff --git a/requirements.txt b/requirements.txt index 5ebd48b..92c3790 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -Django>=2.2.4 +Django~=4.2.9 djangorestframework>=3.10.2 psycopg2-binary>=2.8.3 diff --git a/tests/test_settings.py b/tests/test_settings.py index 42a8309..09e9034 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -11,12 +11,8 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': os.environ.get('DB_NAME'), - 'USER': os.environ.get('DB_USER'), - 'PASSWORD': os.environ.get('DB_PASSWORD'), - 'HOST': os.environ.get('DB_HOST', 'localhost'), - 'PORT': os.environ.get('DB_PORT', 5432) + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': "testdb", }, }