diff --git a/.travis.yml b/.travis.yml index a2f02f5..a568a72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,10 @@ matrix: env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres - python: 3.6 env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis + - python: 3.6 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres + - python: 3.6 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis - python: 3.7 env: DJANGO_VERSION_CEILING=1.12 DJANGO_DB_ENGINE=sqlite - python: 3.7 @@ -82,6 +86,19 @@ matrix: env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres - python: 3.7 env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis + - python: 3.7 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres + - python: 3.7 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis + - python: 3.8 + env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres + - python: 3.8 + env: DJANGO_VERSION_CEILING=2.3 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis + - python: 3.8 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=postgres DJANGO_DB_NAME=testdb DJANGO_DB_USER=postgres + - python: 3.8 + env: DJANGO_VERSION_CEILING=3.1 DJANGO_DB_ENGINE=mysql DJANGO_DB_NAME=testdb DJANGO_DB_USER=travis + install: - pip install "Django<$DJANGO_VERSION_CEILING" mysqlclient psycopg2 - "pip install flake8 pylint pytest pytest-django" diff --git a/AUTHORS.rst b/AUTHORS.rst index 1d2b212..ff92a0c 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -8,3 +8,5 @@ Contributors | `John Lynn `_ | `Dylan Verheul `_ | `Grant McConnaughey `_ +| `Luke Burden `_ +| `James Addison `_ \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d0d7748..cef0d3e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ Changelog ========= +3.3.0 +-------------------- + - Django 3.x support + - switch to BooleanField as base (Django 4.x deprecation) + 3.2.1 -------------------- - Fix rST formatting in this file to pass PyPI rendering check diff --git a/setup.py b/setup.py index c8a650d..c07f7d5 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ install_requires = ( - 'Django>=1.11,<2.3', + 'Django>=1.11,<4', ) @@ -67,7 +67,7 @@ def run_tests(self): setup( name='django-livefield', - version='3.2.1', + version='3.3.0', description='Convenient soft-deletion support for Django models', long_description=( open('README.rst').read() + '\n\n' + @@ -79,6 +79,8 @@ def run_tests(self): 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', + 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.1', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', diff --git a/src/livefield/fields.py b/src/livefield/fields.py index e98f326..8f78549 100644 --- a/src/livefield/fields.py +++ b/src/livefield/fields.py @@ -1,8 +1,13 @@ import django from django.db import models +if django.VERSION < (2, 1): + BooleanField = models.NullBooleanField +else: + BooleanField = models.BooleanField -class LiveField(models.NullBooleanField): + +class LiveField(BooleanField): """Support uniqueness constraints and soft-deletion. Similar to a BooleanField, but stores False as NULL. This lets us use @@ -14,7 +19,7 @@ class LiveField(models.NullBooleanField): description = u'Soft-deletion status' def __init__(self, *args, **kwargs): - super(LiveField, self).__init__(default=True, null=True) + super(LiveField, self).__init__(default=True, null=True, blank=True) def get_prep_value(self, value): # Convert in-Python value to value we'll store in DB