Skip to content

Commit add6826

Browse files
HansAarneLiblikHans Aarne Liblik
and
Hans Aarne Liblik
authored
DomainNameValidator types (#2498)
* Add types for DomainNameValidator * Add types for DomainNameValidator * Update allowlist_todo_django51.txt * make keyword-only --------- Co-authored-by: Hans Aarne Liblik <[email protected]>
1 parent 0a4d7a8 commit add6826

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

django-stubs/core/validators.pyi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ class RegexValidator(_Deconstructible):
3030
) -> None: ...
3131
def __call__(self, value: Any) -> None: ...
3232

33+
class DomainNameValidator(RegexValidator):
34+
ul: str
35+
hostname_re: str
36+
domain_re: str
37+
tld_re: str
38+
ascii_only_hostname_re: str
39+
ascii_only_domain_re: str
40+
ascii_only_tld_re: str
41+
max_length: int
42+
43+
def __init__(self, *, accept_idna: bool = True, **kwargs: Any) -> None: ...
44+
def __call__(self, value: Any) -> None: ...
45+
46+
validate_domain_name: DomainNameValidator
47+
3348
class URLValidator(RegexValidator):
3449
ul: str
3550
ipv4_re: str

scripts/stubtest/allowlist_todo_django51.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ django.core.files.storage.filesystem.FileSystemStorage.__init__
100100
django.core.files.storage.filesystem.FileSystemStorage.is_name_available
101101
django.core.files.storage.get_storage_class
102102
django.core.signing.Signer.__init__
103-
django.core.validators.DomainNameValidator
104-
django.core.validators.validate_domain_name
105103
django.db.backends.base.features.BaseDatabaseFeatures.supports_frame_exclusion
106104
django.db.backends.base.operations.BaseDatabaseOperations.bulk_insert_sql
107105
django.db.backends.base.operations.BaseDatabaseOperations.force_group_by

0 commit comments

Comments
 (0)