Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django5 support #15

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/django4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/django5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python
name: django5

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:

django5:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
pip install -r tests/django5.txt

- name: flake8
run: |
flake8 --count --show-source --statistics --max-line-length=120 django_admin_filters
flake8 --count --show-source --statistics --max-line-length=120 tests/test

- name: pylint
run: |
python -m pylint django_admin_filters
python -m pylint tests/test

- name: pytest
run: |
python manage.py collectstatic --noinput --settings example.settings
python manage.py makemigrations --settings example.settings example
python manage.py migrate --settings example.settings
pytest -c pytest5.ini --cov=django_admin_filters --cov-report xml --cov-report term:skip-covered --durations=5 tests
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DjangoAdminFilters library
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vb64/django.admin.filters/pep257.yml?label=Pep257&style=plastic&branch=main)](https://github.com/vb64/django.admin.filters/actions?query=workflow%3Apep257)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vb64/django.admin.filters/django3.yml?label=Django%203.2.20%20Python%203.7-3.10&style=plastic&branch=main)](https://github.com/vb64/django.admin.filters/actions?query=workflow%3Adjango3)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vb64/django.admin.filters/django4.yml?label=Django%204.2.3%20Python%203.8-3.11&style=plastic&branch=main)](https://github.com/vb64/django.admin.filters/actions?query=workflow%3Adjango4)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vb64/django.admin.filters/django3.yml?label=Django%203.2.23%20Python%203.7-3.10&style=plastic&branch=main)](https://github.com/vb64/django.admin.filters/actions?query=workflow%3Adjango3)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/vb64/django.admin.filters/django4.yml?label=Django%204.2.8%20Python%203.8-3.11&style=plastic&branch=main)](https://github.com/vb64/django.admin.filters/actions?query=workflow%3Adjango4)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/926ec3c1141f4230b4d0508497e5561f)](https://app.codacy.com/gh/vb64/django.admin.filters/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/926ec3c1141f4230b4d0508497e5561f)](https://app.codacy.com/gh/vb64/django.admin.filters/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/django-admin-list-filters?label=pypi%20installs)](https://pypistats.org/packages/django-admin-list-filters)
Expand Down
7 changes: 7 additions & 0 deletions django_admin_filters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def __init__(self, field, request, params, model, model_admin, field_path):
super().__init__(field, request, params, model, model_admin, field_path)
self.set_title()

def get_facet_counts(self, _pk_attname, _filtered_qs):
"""Django5 amin site Facets.

https://docs.djangoproject.com/en/5.0/ref/contrib/admin/filters/#facet-filters
"""
return {}

def value(self):
"""Return the string provided in the request's query string.

Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PTEST = ./venv/bin/pytest
COVERAGE = ./venv/bin/coverage
endif

DJANGO_VER = 4
DJANGO_VER = 5

SOURCE = django_admin_filters
TESTS = tests
Expand Down
3 changes: 3 additions & 0 deletions pytest5.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore::django.utils.deprecation.RemovedInDjango51Warning
2 changes: 1 addition & 1 deletion tests/django3.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Django==3.2.20
Django==3.2.23
2 changes: 1 addition & 1 deletion tests/django4.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Django==4.2.3
Django==4.2.8
1 change: 1 addition & 0 deletions tests/django5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Django==5.0
Loading