Skip to content

Commit 5218b4f

Browse files
authored
5.0: Update django.db.models.constraints.UniqueConstraint (#2175)
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
1 parent e5bda21 commit 5218b4f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django-stubs/db/models/constraints.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class UniqueConstraint(BaseConstraint):
5353
fields: Sequence[str]
5454
condition: Q | None
5555
deferrable: Deferrable | None
56+
nulls_distinct: bool | None
5657

5758
@overload
5859
def __init__(
@@ -64,6 +65,7 @@ class UniqueConstraint(BaseConstraint):
6465
deferrable: Deferrable | None = ...,
6566
include: Sequence[str] | None = ...,
6667
opclasses: Sequence[Any] = ...,
68+
nulls_distinct: bool | None = ...,
6769
violation_error_code: str | None = ...,
6870
violation_error_message: _StrOrPromise | None = ...,
6971
) -> None: ...

0 commit comments

Comments
 (0)