Skip to content

fix: update CheckConstraint to use condition= for Django 6 compatibility - #67

Open
danaspiegel wants to merge 2 commits into
flamingo-run:mainfrom
danaspiegel:fix/django-6-checkconstraint-compatibility
Open

fix: update CheckConstraint to use condition= for Django 6 compatibility#67
danaspiegel wants to merge 2 commits into
flamingo-run:mainfrom
danaspiegel:fix/django-6-checkconstraint-compatibility

Conversation

@danaspiegel

Copy link
Copy Markdown

Summary

  • Updated CheckConstraint to use condition= parameter instead of deprecated check= parameter
  • This change is required for Django 6.0 compatibility, where the check= parameter was removed
  • Updated both model definitions and existing migrations

Background

Django 4.1 deprecated the check= parameter in favor of condition= for consistency with other constraint classes. Django 6.0 removed the deprecated parameter entirely.

Files Changed

  • drf_kit/models/availability_models.py - Main library constraint definition
  • test_app/models.py - Test model constraint
  • test_app/migrations/0004_newspaper_roomofrequirement_and_more.py - Historical migration
  • test_app/migrations/0007_beast_beast_test_app_be_updated_682cc9_idx_and_more.py - Historical migration

Test plan

  • Verify tests pass on Django 5.x (backward compatible)
  • Verify tests pass on Django 6.0

🤖 Generated with Claude Code

danaspiegel and others added 2 commits January 22, 2026 18:08
Django 6.0 removed the deprecated check= parameter from CheckConstraint
in favor of condition=. This change was deprecated since Django 4.1.

Updated:
- drf_kit/models/availability_models.py
- test_app/models.py
- test_app/migrations/0004_newspaper_roomofrequirement_and_more.py
- test_app/migrations/0007_beast_beast_test_app_be_updated_682cc9_idx_and_more.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The InvalidRecord exception handler was accessing the deprecated
constraint.check attribute which is removed in Django 6.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@danaspiegel

Copy link
Copy Markdown
Author

Fixes /issues/66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant