Skip to content

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

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

Closed
decadecity opened this issue Aug 11, 2024 · 1 comment · Fixed by #108
Closed

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

decadecity opened this issue Aug 11, 2024 · 1 comment · Fixed by #108
Labels
database-backend Issues relating to the database backend good first issue Good for newcomers

Comments

@decadecity
Copy link

decadecity commented Aug 11, 2024

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

  • Python 3.11.4
  • Django 5.1.0
  • django-tasks 0.3.0
@RealOrangeOne
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
database-backend Issues relating to the database backend good first issue Good for newcomers
Projects
None yet
2 participants