Skip to content

Commit

Permalink
Merge pull request #3 from uktrade/upgrading-django
Browse files Browse the repository at this point in the history
Upgrading django
  • Loading branch information
chris-pettinga authored Feb 2, 2024
2 parents c2b9534 + 15e6382 commit b94479d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 14 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions feedback/models.py
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion feedback/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4'
__version__ = '0.5'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Django>=2.2.4
Django~=4.2.9
djangorestframework>=3.10.2
psycopg2-binary>=2.8.3
8 changes: 2 additions & 6 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}

Expand Down

0 comments on commit b94479d

Please sign in to comment.