Skip to content

Commit ed9df08

Browse files
committed
Deprecate no-index-together
1 parent 051c1fc commit ed9df08

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,23 @@ jobs:
1919
strategy:
2020
matrix:
2121
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
22-
python-version: [3.8, 3.9, "3.10", "3.11"]
22+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0-rc.3"]
2323
django-version:
2424
- "Django>=3.2,<4.0"
2525
- "Django>=4.1,<4.2"
2626
- "Django>=4.2,<5.0"
27-
- "https://github.com/django/django/archive/main.tar.gz"
27+
- "Django>=5.0a1,<5.1"
28+
# - "https://github.com/django/django/archive/main.tar.gz"
2829
include:
2930
- drf: djangorestframework
3031
python-version: "3.11"
3132
django-version: "Django<4.2,>=4.1" # must be different from django-version
3233
- django-version: "Django<4.0,>=3.2"
3334
python-version: 3.7
3435
exclude:
35-
- django-version: "https://github.com/django/django/archive/main.tar.gz"
36+
- django-version: "Django>=5.0a1,<5.1"
3637
python-version: 3.8
37-
- django-version: "https://github.com/django/django/archive/main.tar.gz"
38+
- django-version: "Django>=5.0a1,<5.1"
3839
python-version: 3.9
3940

4041
steps:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ Collection of useful checks for Django Checks Frameworks
99
- **extra-checks-config** - settings.EXTRA_CHECKS is valid config for django-extra-checks (always enabled).
1010
- **model-attribute** - Each Model in the project must have all attributes from `attrs` setting specified.
1111
- **model-meta-attribute** - Each Model.Meta in the project must have all attributes from `attrs` setting specified.
12-
- **no-unique-together** - Use UniqueConstraint with the constraints option instead.
13-
- **no-index-together** - Use the indexes option instead.
12+
- **no-unique-together** - Use `UniqueConstraint` with the `constraints` option instead.
13+
- **no-index-together** - [DEPRECATED] Use the `indexes` option instead.
1414
- **model-admin** - Each model must be registered in admin.
15-
- **field-file-upload-to** - FileField/ImageField must have non empty `upload_to` argument.
15+
- **field-file-upload-to** - `FileField` / `ImageField` must have non empty `upload_to` argument.
1616
- **field-verbose-name** - All model's fields must have verbose name.
17-
- **field-verbose-name-gettext** - verbose_name must use gettext.
17+
- **field-verbose-name-gettext** - `verbose_name` must use gettext.
1818
- **field-verbose-name-gettext-case** - Words in text wrapped with gettext must be in one case.
19-
- **field-help-text-gettext** - help_text must use gettext.
19+
- **field-help-text-gettext** - `help_text` must use gettext.
2020
- **field-text-null** - text fields shouldn't use `null=True`.
21-
- **field-boolean-null** - prefer using `BooleanField(null=True)` instead of `NullBooleanField`.
21+
- **field-boolean-null** - [DEPRECATED] prefer using `BooleanField(null=True)` instead of `NullBooleanField`.
2222
- **field-null** - don't pass `null=False` to model fields (this is django default).
2323
- **field-foreign-key-db-index** - ForeignKey fields must specify `db_index` explicitly (to apply only to fields in indexes: `when: indexes`).
2424
- **field-related-name** - Related fields must specify `related_name` explicitly.

src/extra_checks/checks/model_checks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ def apply(
184184
@registry.register(django.core.checks.Tags.models)
185185
class CheckNoIndexTogether(CheckModelMeta):
186186
Id = CheckId.X014
187+
deprecation_warnings = [
188+
"`no-index-together` check is deprecated and will be removed in a future version"
189+
]
187190

188191
def apply(
189192
self, model: Type[models.Model], ast: ModelASTProtocol

0 commit comments

Comments
 (0)