From 5c0ace798f23b6e3eb167e12fb24e91d059b4803 Mon Sep 17 00:00:00 2001 From: George Kettleborough Date: Wed, 11 Oct 2023 22:15:10 +0100 Subject: [PATCH 1/2] Add Model.validate_constraints --- django-stubs/db/models/base.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index 8e2b03454..6f51a5ab4 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -51,6 +51,7 @@ class Model(metaclass=ModelBase): def clean(self) -> None: ... def clean_fields(self, exclude: Collection[str] | None = ...) -> None: ... def validate_unique(self, exclude: Collection[str] | None = ...) -> None: ... + def validate_constraints(self, exclude: Collection[str] | None = ...) -> None: ... def unique_error_message( self, model_class: type[Self], From 15df577bac54039f38972be4f2ae6747444309cd Mon Sep 17 00:00:00 2001 From: George Kettleborough Date: Wed, 11 Oct 2023 22:16:34 +0100 Subject: [PATCH 2/2] Use ellipses in type stubs --- django-stubs/db/models/base.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index 6f51a5ab4..6970a54b4 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -45,8 +45,8 @@ class Model(metaclass=ModelBase): def full_clean( self, exclude: Collection[str] | None = ..., - validate_unique: bool = True, - validate_constraints: bool = True, + validate_unique: bool = ..., + validate_constraints: bool = ..., ) -> None: ... def clean(self) -> None: ... def clean_fields(self, exclude: Collection[str] | None = ...) -> None: ...