From 41d433980ba2dc23fd58abd71c0a2b0da33c1e77 Mon Sep 17 00:00:00 2001 From: James Addison Date: Fri, 25 Sep 2020 09:16:27 -0700 Subject: [PATCH] Aadditional updates to address Django 3.x (and prepping for 4.x!) compatibility. --- AUTHORS.rst | 1 + CHANGELOG.rst | 5 +++++ setup.py | 4 +++- src/livefield/fields.py | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 09c9923..ff92a0c 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -9,3 +9,4 @@ Contributors | `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 1a3032f..c07f7d5 100755 --- a/setup.py +++ b/setup.py @@ -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..b20fe36 100644 --- a/src/livefield/fields.py +++ b/src/livefield/fields.py @@ -2,7 +2,7 @@ from django.db import models -class LiveField(models.NullBooleanField): +class LiveField(models.BooleanField): """Support uniqueness constraints and soft-deletion. Similar to a BooleanField, but stores False as NULL. This lets us use @@ -14,7 +14,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