RealOrangeOne / django-tasks

A reference implementation and backport of background workers and tasks in Django
https://pypi.org/project/django-tasks/
BSD 3-Clause "New" or "Revised" License
285 stars 22 forks source link

CheckConstraint.check is marked as deprecated in Django 5.1 #100

Open decadecity opened 1 month ago

decadecity commented 1 month ago

I've upgraded the project I'm using to trial tasks to Django 5.1 and I am now receiving the following deprecation warning:

django_tasks/backends/database/models.py:103: RemovedInDjango60Warning: CheckConstraint.check is deprecated in favor of '.condition'.

Per the Django 5.1 release notes:

  • The check keyword argument of CheckConstraint is deprecated in favor of condition.

This is also reflected in the documentation for CheckConstraint

Environment

RealOrangeOne commented 1 month ago

It's deprecated, but condition isn't supported in 4.2.

I'm open to adding a Django version check, and passing either condition or check as needed, so long as it's not much additional complexity.