Skip to content

Commit

Permalink
5.0: Update django.db.models.constraints.UniqueConstraint (#2175)
Browse files Browse the repository at this point in the history
Reflects the nulls_distinct option of the UniqueConstraint class. Adds
the attribute and the arg to the two versions of the __init__ type
definitions.

https://docs.djangoproject.com/en/5.0/ref/models/constraints/#nulls-distinct
  • Loading branch information
steve148 committed May 21, 2024
1 parent e5bda21 commit 5218b4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django-stubs/db/models/constraints.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class UniqueConstraint(BaseConstraint):
fields: Sequence[str]
condition: Q | None
deferrable: Deferrable | None
nulls_distinct: bool | None

@overload
def __init__(
Expand All @@ -64,6 +65,7 @@ class UniqueConstraint(BaseConstraint):
deferrable: Deferrable | None = ...,
include: Sequence[str] | None = ...,
opclasses: Sequence[Any] = ...,
nulls_distinct: bool | None = ...,
violation_error_code: str | None = ...,
violation_error_message: _StrOrPromise | None = ...,
) -> None: ...
Expand Down

0 comments on commit 5218b4f

Please sign in to comment.