From b0c2c4435101fe426effb842be09bf3ca8cecd9f Mon Sep 17 00:00:00 2001 From: Nathan Shafer Date: Tue, 9 Jan 2024 14:30:02 -0700 Subject: [PATCH] Bump version 3.4.0 w/ Django 5 support --- .github/workflows/tests.yml | 9 ++++++--- CHANGELOG.md | 5 +++++ README.rst | 13 ++++++++++--- hashid_field/__init__.py | 2 +- setup.py | 11 ++++++----- tox.ini | 17 ++++++++++------- 6 files changed, 38 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8ff3c0..189c9d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,12 +13,15 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11" + - "3.12" django: - - "3.2.13" - - "4.0.5" + - "3.2.23" + - "4.2.9" + - "5.0.1" drf: - "no" - - "3.13.1" + - "3.14.0" name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}" runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b2ef5b..d61c71c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [3.4.0] - 2024-01-09 +- Add support for Django 5.0 +- Drop support for Django < 3.2, 4.0, 4.1 + ## [3.3.7] - 2022-10-18 - [#74]: Fix regression introduced in 3.3.2 that allowed integer lookups even when allow_int_lookups was set to False, in the specific case that the integer being looked up was equal to or fewer characters than the prefix for the field. @@ -270,6 +274,7 @@ with 1.11 and DRF 3.7.3, so we are supporting (and testing) DRF 3.6.4 for Django ### Added - Initial release +[3.4.0]: https://github.com/nshafer/django-hashid-field/compare/3.3.7...3.4.0 [3.3.7]: https://github.com/nshafer/django-hashid-field/compare/3.3.6...3.3.7 [3.3.6]: https://github.com/nshafer/django-hashid-field/compare/3.3.5...3.3.6 [3.3.5]: https://github.com/nshafer/django-hashid-field/compare/3.3.4...3.3.5 diff --git a/README.rst b/README.rst index 21c0018..f02aad7 100644 --- a/README.rst +++ b/README.rst @@ -35,10 +35,10 @@ Requirements This module is tested and known to work with: -* Python 3.7, 3.8, 3.9, 3.10 -* Django 3.2, 4.0 +* Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 +* Django 3.2, 4.2, 5.0 * Hashids 1.3 -* Django REST Framework 3.13 +* Django REST Framework 3.14 *Please Note*: Python 2.x is at its end of life and is no longer supported. @@ -609,6 +609,13 @@ Hashid\*Field. See `HashidSerializerCharField`_ for parameters. *Please Note*: This field will always serialize to an integer and thus will also de-serialize integers into valid objects, regardless of the `allow_int_lookup` setting. +Known Issues +============ + +With Django 5.0, attempting to filter on a field that is a ForeignKey to another model that uses a Hashid*Field as its +primary key will result in an error such as "'Hashid' object is not iterable". The workaround is to specify the exact +field of the related model to filter on. e.g. instead of `list_filter = ['author']` use `list_filter = ['author__name']`. + Development =========== diff --git a/hashid_field/__init__.py b/hashid_field/__init__.py index bdf5413..1658c28 100644 --- a/hashid_field/__init__.py +++ b/hashid_field/__init__.py @@ -2,7 +2,7 @@ from .hashid import Hashid __title__ = 'Django Hashid Field' -__version__ = "3.3.7" +__version__ = "3.4.0" __author__ = 'Nathan Shafer' __license__ = 'MIT License' __copyright__ = 'Copyright 2017-2021 Nathan Shafer' diff --git a/setup.py b/setup.py index 5a0cd26..adb43a2 100644 --- a/setup.py +++ b/setup.py @@ -88,16 +88,17 @@ def get_version(package): # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', # Django 'Framework :: Django', - 'Framework :: Django :: 1.11', - 'Framework :: Django :: 2.1', - 'Framework :: Django :: 2.2', - 'Framework :: Django :: 3.0', + 'Framework :: Django :: 3.2', + 'Framework :: Django :: 4.2', + 'Framework :: Django :: 5.0', ], # What does your project relate to? diff --git a/tox.ini b/tox.ini index e1700dd..d20e99f 100644 --- a/tox.ini +++ b/tox.ini @@ -5,14 +5,17 @@ [tox] envlist = py37-django32-{rest,norest}, - py38-django{32,40}-{rest,norest} - py39-django{32,40}-{rest,norest} - py310-django{32,40}-{rest,norest} + py38-django{32,42}-{rest,norest} + py39-django{32,42}-{rest,norest} + py310-django{32,42,50}-{rest,norest} + py311-django{42,50}-{rest,norest} + py312-django{42,50}-{rest,norest} [testenv] commands = python runtests.py deps = - hashids>=1.3. - django32: Django==3.2.13 - django40: Django==4.0.5 - rest: djangorestframework==3.13.1 + hashids>=1.3.1 + django32: Django==3.2.23 + django42: Django==4.2.9 + django50: Django==5.0.1 + rest: djangorestframework==3.14.0