Skip to content

Commit

Permalink
[5.0] Update core.validators (#1947)
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos authored Feb 15, 2024
1 parent f45332f commit b16bc8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions django-stubs/core/validators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,20 @@ class BaseValidator(_Deconstructible):
message: _StrOrPromise
code: str
limit_value: Any
def __init__(self, limit_value: Any, message: _StrOrPromise | None = ...) -> None: ...
def __init__(self, limit_value: Any | Callable[[], Any], message: _StrOrPromise | None = ...) -> None: ...
def __call__(self, value: Any) -> None: ...
def compare(self, a: Any, b: Any) -> bool: ...
def clean(self, x: Any) -> Any: ...
def __eq__(self, other: object) -> bool: ...

class MaxValueValidator(BaseValidator): ...
class MinValueValidator(BaseValidator): ...
class StepValueValidator(BaseValidator): ...

class StepValueValidator(BaseValidator):
offset: int | None
def __init__(
self, limit_value: Any | Callable[[], Any], message: _StrOrPromise | None = ..., offset: int | None = ...
) -> None: ...

class MinLengthValidator(BaseValidator):
def clean(self, x: Sized) -> int: ...
Expand Down
1 change: 0 additions & 1 deletion scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ django.core.management.commands.optimizemigration
django.core.paginator.Paginator.__init__
django.core.paginator.Paginator.default_error_messages
django.core.serializers.base.PickleSerializer
django.core.validators.StepValueValidator.__init__
django.db.backends.base.base.timezone_constructor
django.db.backends.base.features.BaseDatabaseFeatures.delete_can_self_reference_subquery
django.db.backends.base.features.BaseDatabaseFeatures.insert_test_table_with_defaults
Expand Down

0 comments on commit b16bc8b

Please sign in to comment.