diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a4c30d22..cd0c5da4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,6 +17,7 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11" steps: - uses: actions/checkout@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 625b2cd6..e27f3c58 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,12 +12,12 @@ repos: - id: file-contents-sorter files: .gitignore - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.10.1 hooks: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/adamchainz/django-upgrade - rev: 1.13.0 + rev: 1.14.0 hooks: - id: django-upgrade args: [--target-version, "3.2"] @@ -27,16 +27,16 @@ repos: - id: isort args: [--profile=black, --lines-after-imports=2, --combine-as] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 args: ["--ignore=E203,E501,W503"] - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.35.0 + rev: v8.46.0 hooks: - id: eslint args: [--fix] @@ -48,7 +48,7 @@ repos: - "@babel/eslint-parser" - "@babel/preset-env" - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.0.0-alpha.6 + rev: v3.0.1 hooks: - id: prettier args: [--list-different, --no-semi] diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e67fbd74..74a5dc1b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,19 @@ Change log `Next version`_ ~~~~~~~~~~~~~~~ -.. _Next version: https://github.com/feincms/feincms/compare/v23.1.0...main +.. _Next version: https://github.com/feincms/feincms/compare/v23.8.0...main + + +`v23.8.0`_ (2023-08-07) +~~~~~~~~~~~~~~~~~~~~~~~ + +.. _v23.8.0: https://github.com/feincms/feincms/compare/v23.1.0...v23.8.0 + +- Made the filter argument of content base's ``get_queryset`` method optional. + This enables easier interoperability of FeinCMS content types with feincms3 + plugins. +- Added Python 3.11. +- Fixed the Pillow resampling constant. `v23.1.0`_ (2023-03-09) diff --git a/feincms/__init__.py b/feincms/__init__.py index dbff7b49..b3462a34 100644 --- a/feincms/__init__.py +++ b/feincms/__init__.py @@ -1,4 +1,4 @@ -VERSION = (23, 1, 0) +VERSION = (23, 8, 0) __version__ = ".".join(map(str, VERSION)) diff --git a/feincms/models.py b/feincms/models.py index be587ed5..bb8abeba 100644 --- a/feincms/models.py +++ b/feincms/models.py @@ -210,7 +210,7 @@ def _populate_content_type_caches(self, types): if cls not in self._cache["cts"]: if counts: self._cache["cts"][cls] = list( - cls.get_queryset( + cls.get_queryset().filter( reduce( operator.or_, (Q(region=r[0], parent=r[1]) for r in counts), @@ -500,8 +500,11 @@ def render(self, **kwargs): raise NotImplementedError - def get_queryset(cls, filter_args): - return cls.objects.select_related().filter(filter_args) + def get_queryset(cls, filter_args=None): + qs = cls.objects.select_related() + if filter_args is not None: + return qs.filter(filter_args) + return qs attrs = { # The basic content type is put into diff --git a/tox.ini b/tox.ini index be29261a..3fd4055b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{38,39,310}-dj{32,41,42} - py{310}-dj{32,41,42,main} + py{310,311}-dj{32,41,42,main} [testenv] usedevelop = true @@ -12,5 +12,5 @@ commands = deps = dj32: Django>=3.2,<4.0 dj41: Django>=4.1,<4.2 - dj42: Django>=4.2a1,<5.0 + dj42: Django>=4.2,<5.0 djmain: https://github.com/django/django/archive/main.tar.gz