From 4acd63fb0b10dd1cf1ae7a3b10405746b9632957 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 9 Aug 2025 11:25:57 +0200 Subject: [PATCH 1/2] Update usage deprecated in Django 5.1 The `check` argument was deprecated in Django 5.1. Note that this is incompatible with Django 4.2. See: https://docs.djangoproject.com/en/5.1/ref/models/constraints/#checkconstraint --- .../migrations/0011_receiptentry_discount_and_more.py | 4 ++-- django_afip/models.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/django_afip/migrations/0011_receiptentry_discount_and_more.py b/django_afip/migrations/0011_receiptentry_discount_and_more.py index dfacb00f..c12e3a36 100644 --- a/django_afip/migrations/0011_receiptentry_discount_and_more.py +++ b/django_afip/migrations/0011_receiptentry_discount_and_more.py @@ -29,14 +29,14 @@ class Migration(migrations.Migration): migrations.AddConstraint( model_name="receiptentry", constraint=models.CheckConstraint( - check=models.Q(("discount__gte", Decimal("0.0"))), + condition=models.Q(("discount__gte", Decimal("0.0"))), name="discount_positive_value", ), ), migrations.AddConstraint( model_name="receiptentry", constraint=models.CheckConstraint( - check=models.Q( + condition=models.Q( ( "discount__lte", django.db.models.expressions.CombinedExpression( diff --git a/django_afip/models.py b/django_afip/models.py index 4b5e87e9..c45a311a 100644 --- a/django_afip/models.py +++ b/django_afip/models.py @@ -1693,10 +1693,11 @@ class Meta: verbose_name_plural = _("receipt entries") constraints = ( CheckConstraint( - check=Q(discount__gte=Decimal("0.0")), name="discount_positive_value" + condition=Q(discount__gte=Decimal("0.0")), + name="discount_positive_value", ), CheckConstraint( - check=Q(discount__lte=F("quantity") * F("unit_price")), + condition=Q(discount__lte=F("quantity") * F("unit_price")), name="discount_less_than_total", ), ) From 335965677a8225f0c1a9a8d0321e755073d9a2e5 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Sat, 9 Aug 2025 11:28:18 +0200 Subject: [PATCH 2/2] Drop support for Django 4.2 --- .builds/py311-alpine.yml | 6 ------ .builds/py312+live-alpine.yml | 6 ------ docs/changelog.rst | 1 + pyproject.toml | 3 +-- tox.ini | 1 - 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/.builds/py311-alpine.yml b/.builds/py311-alpine.yml index 3ea2d5f9..11febef2 100644 --- a/.builds/py311-alpine.yml +++ b/.builds/py311-alpine.yml @@ -26,15 +26,9 @@ tasks: - tox-sqlite: | cd django-afip tox -e sqlite - - tox-django42-mariadb: | - cd django-afip - tox -e django42-mysql - tox-django50-mariadb: | cd django-afip tox -e django50-mysql - - tox-django42-postgres: | - cd django-afip - tox -e django42-postgres - tox-django50-postgres: | cd django-afip tox -e django50-postgres diff --git a/.builds/py312+live-alpine.yml b/.builds/py312+live-alpine.yml index f29783c2..f4110ba4 100644 --- a/.builds/py312+live-alpine.yml +++ b/.builds/py312+live-alpine.yml @@ -26,15 +26,9 @@ tasks: - tox-sqlite: | cd django-afip tox -e sqlite - - tox-django42-mariadb: | - cd django-afip - tox -e django42-mysql - tox-django50-mariadb: | cd django-afip tox -e django50-mysql - - tox-django42-postgres: | - cd django-afip - tox -e django42-postgres - tox-django50-postgres: | cd django-afip tox -e django50-postgres diff --git a/docs/changelog.rst b/docs/changelog.rst index 045d811b..932123c1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -21,6 +21,7 @@ Any breaking changes which require intervention will be mentioned here. - Extend supported versions of ``django-renderpdf``, ``qrcode`` and ``cryptography``. - Drop support for Python 3.9. +* Dropped support for Django 4.2. 13.2.2 ------ diff --git a/pyproject.toml b/pyproject.toml index e7d4b107..c2e79251 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ classifiers = [ "Development Status :: 6 - Mature", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 4.2", "Framework :: Django :: 5.0", "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", @@ -30,7 +29,7 @@ classifiers = [ ] dependencies = [ "cryptography>=3.2,<47", - "django>=4.2,<5.3", + "django>=5.0,<5.3", "django_renderpdf>=6.0.0,<7.0.0", "lxml>=3.4.4", "pyopenssl>=16.2.0", diff --git a/tox.ini b/tox.ini index 92db0005..da451fd3 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,6 @@ extras = postgres: postgres mysql: mysql deps = - django42: Django>=4.0,<4.2 django50: Django>=5.0,<5.1 django51: Django>=5.1,<5.2 django52: Django>=5.2,<5.3