Skip to content

Missing constraint field for constraint related migration operations #2947

@SpyrosRoum

Description

@SpyrosRoum

Bug report

What's wrong

The AddConstraint and AlterConstraint migration operations should have a constraint field.

Example code:

    def foo(self, op: AddConstraint) -> Any:
        return op.constraint

Result of running mypy on it:
error: "AddConstraint" has no attribute "constraint" [attr-defined]

How is that should be

The constraint field should be added to these operations

System information

  • OS: MacOS 15.7.1
  • python version: 3.12.x
  • django version: 5.2.x
  • mypy version: 1.18.2
  • django-stubs version: 5.2.7
  • django-stubs-ext version: 5.2.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions