Skip to content

Commit

Permalink
Deprecate no-index-together
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekseev committed Oct 2, 2023
1 parent 051c1fc commit 4f30b9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ jobs:
strategy:
matrix:
# https://github.com/actions/python-versions/blob/main/versions-manifest.json
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12.0-rc.3"]
django-version:
- "Django>=3.2,<4.0"
- "Django>=4.1,<4.2"
- "Django>=4.2,<5.0"
- "https://github.com/django/django/archive/main.tar.gz"
- "Django>=5.0,<5.1"
# - "https://github.com/django/django/archive/main.tar.gz"
include:
- drf: djangorestframework
python-version: "3.11"
django-version: "Django<4.2,>=4.1" # must be different from django-version
- django-version: "Django<4.0,>=3.2"
python-version: 3.7
exclude:
- django-version: "https://github.com/django/django/archive/main.tar.gz"
- django-version: "Django>=5.0,<5.1"
python-version: 3.8
- django-version: "https://github.com/django/django/archive/main.tar.gz"
- django-version: "Django>=5.0,<5.1"
python-version: 3.9

steps:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ Collection of useful checks for Django Checks Frameworks
- **extra-checks-config** - settings.EXTRA_CHECKS is valid config for django-extra-checks (always enabled).
- **model-attribute** - Each Model in the project must have all attributes from `attrs` setting specified.
- **model-meta-attribute** - Each Model.Meta in the project must have all attributes from `attrs` setting specified.
- **no-unique-together** - Use UniqueConstraint with the constraints option instead.
- **no-index-together** - Use the indexes option instead.
- **no-unique-together** - Use `UniqueConstraint` with the `constraints` option instead.
- **no-index-together** - [DEPRECATED] Use the `indexes` option instead.
- **model-admin** - Each model must be registered in admin.
- **field-file-upload-to** - FileField/ImageField must have non empty `upload_to` argument.
- **field-file-upload-to** - `FileField` / `ImageField` must have non empty `upload_to` argument.
- **field-verbose-name** - All model's fields must have verbose name.
- **field-verbose-name-gettext** - verbose_name must use gettext.
- **field-verbose-name-gettext** - `verbose_name` must use gettext.
- **field-verbose-name-gettext-case** - Words in text wrapped with gettext must be in one case.
- **field-help-text-gettext** - help_text must use gettext.
- **field-help-text-gettext** - `help_text` must use gettext.
- **field-text-null** - text fields shouldn't use `null=True`.
- **field-boolean-null** - prefer using `BooleanField(null=True)` instead of `NullBooleanField`.
- **field-boolean-null** - [DEPRECATED] prefer using `BooleanField(null=True)` instead of `NullBooleanField`.
- **field-null** - don't pass `null=False` to model fields (this is django default).
- **field-foreign-key-db-index** - ForeignKey fields must specify `db_index` explicitly (to apply only to fields in indexes: `when: indexes`).
- **field-related-name** - Related fields must specify `related_name` explicitly.
Expand Down
3 changes: 3 additions & 0 deletions src/extra_checks/checks/model_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ def apply(
@registry.register(django.core.checks.Tags.models)
class CheckNoIndexTogether(CheckModelMeta):
Id = CheckId.X014
deprecation_warnings = [
"`no-index-together` check is deprecated and will be removed in version 0.14.0"
]

def apply(
self, model: Type[models.Model], ast: ModelASTProtocol
Expand Down

0 comments on commit 4f30b9a

Please sign in to comment.