Handle CheckConstraint.check -> condition.

Review Request #14743 — Created Dec. 22, 2025 and updated

Information

Django Evolution
master

Reviewers

Django 5.1 renamed the check argument/field inside CheckConstraint
to condition, and 6.0 removed the check argument entirely. This
change adds a support flag and conditions to handle these updates. The
ChangeMeta and ConstraintSignature objects have been updated to
normalize old evolutions and signatures appropriately.

Ran unit tests.

Summary ID
Handle CheckConstraint.check -> condition.
Django 5.1 renamed the `check` argument/field inside `CheckConstraint` to `condition`, and 6.0 removed the `check` argument entirely. This change adds a support flag and conditions to handle these updates. The `ChangeMeta` and `ConstraintSignature` objects have been updated to normalize old evolutions and signatures appropriately. Testing Done: Ran unit tests.
nnsntwsplxpzozktqypmupvyxlqxrqyn
Description From Last Updated

) should be on the next line, with a comma on this line.

chipx86chipx86

This can be one statement.

chipx86chipx86

This can also be one statement.

chipx86chipx86

These, too.

chipx86chipx86

) should be on the next line, with a comma on this line.

chipx86chipx86

This can be one statement.

chipx86chipx86

line too long (81 > 79 characters) Column: 80 Error code: E501

reviewbotreviewbot

As we type things, we'll need to make a decision on whether the classes own the arguments going in, or …

chipx86chipx86

This should probably use is.

chipx86chipx86

Instead of the del, you can use .pop().

chipx86chipx86

This should probably use is for comparison.

chipx86chipx86

This is missing a Version Added.

chipx86chipx86

We do this a lot. We may want to just have a global.

chipx86chipx86
chipx86
  1. We'll need to handle evolutions using one form or the other, ensuring the attribute is renamed for the target version of Django.

  2. Show all issues

    ) should be on the next line, with a comma on this line.

  3. django_evolution/tests/test_change_meta.py (Diff revision 1)
     
     
     
     
    Show all issues

    This can be one statement.

  4. django_evolution/tests/test_change_meta.py (Diff revision 1)
     
     
     
     
    Show all issues

    This can also be one statement.

  5. django_evolution/tests/test_change_meta.py (Diff revision 1)
     
     
     
     
     
     
     
     
    Show all issues

    These, too.

  6. Show all issues

    ) should be on the next line, with a comma on this line.

  7. django_evolution/tests/test_signature.py (Diff revision 1)
     
     
     
    Show all issues

    This can be one statement.

  8. 
      
david
Review request changed
Summary:
Handle CheckConstraint.check -> condition
Handle CheckConstraint.check -> condition.
Description:
   

Django 5.1 renamed the check argument/field inside CheckConstraint

    to condition, and 6.0 removed the check argument entirely. This
~   change adds a support flag and conditions to handle these updates.

  ~ change adds a support flag and conditions to handle these updates. The
  + ChangeMeta and ConstraintSignature objects have been updated to
  + normalize old evolutions and signatures appropriately.

Commits:
Summary ID
Handle CheckConstraint.check -> condition
Django 5.1 renamed the `check` argument/field inside `CheckConstraint` to `condition`, and 6.0 removed the `check` argument entirely. This change adds a support flag and conditions to handle these updates. Testing Done: Ran unit tests.
nnsntwsplxpzozktqypmupvyxlqxrqyn
Handle CheckConstraint.check -> condition.
Django 5.1 renamed the `check` argument/field inside `CheckConstraint` to `condition`, and 6.0 removed the `check` argument entirely. This change adds a support flag and conditions to handle these updates. The `ChangeMeta` and `ConstraintSignature` objects have been updated to normalize old evolutions and signatures appropriately. Testing Done: Ran unit tests.
nnsntwsplxpzozktqypmupvyxlqxrqyn

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. 
      
  2. django_evolution/mutations/change_meta.py (Diff revision 3)
     
     
     
     
     
    Show all issues

    As we type things, we'll need to make a decision on whether the classes own the arguments going in, or if those values should be untouched.

    My feeling is they should be untouched, so the definitions don't have any side-effects.

    In that case, we'd need to make sure we copy new_value before modifying it.

    If we don't go that way, we need to make sure we document that the argument may be modified by this class.

  3. Show all issues

    This should probably use is.

  4. django_evolution/mutations/change_meta.py (Diff revision 3)
     
     
     
    Show all issues

    Instead of the del, you can use .pop().

  5. django_evolution/signature.py (Diff revision 3)
     
     
    Show all issues

    This should probably use is for comparison.

  6. django_evolution/support.py (Diff revision 3)
     
     
     
     
     
    Show all issues

    This is missing a Version Added.

  7. django_evolution/tests/test_change_meta.py (Diff revision 3)
     
     
     
     
     
    Show all issues

    We do this a lot. We may want to just have a global.

  8. 
      
david
Review request changed
Commits:
Summary ID
Handle CheckConstraint.check -> condition.
Django 5.1 renamed the `check` argument/field inside `CheckConstraint` to `condition`, and 6.0 removed the `check` argument entirely. This change adds a support flag and conditions to handle these updates. The `ChangeMeta` and `ConstraintSignature` objects have been updated to normalize old evolutions and signatures appropriately. Testing Done: Ran unit tests.
nnsntwsplxpzozktqypmupvyxlqxrqyn
Handle CheckConstraint.check -> condition.
Django 5.1 renamed the `check` argument/field inside `CheckConstraint` to `condition`, and 6.0 removed the `check` argument entirely. This change adds a support flag and conditions to handle these updates. The `ChangeMeta` and `ConstraintSignature` objects have been updated to normalize old evolutions and signatures appropriately. Testing Done: Ran unit tests.
nnsntwsplxpzozktqypmupvyxlqxrqyn

Checks run (2 succeeded)

flake8 passed.
JSHint passed.