Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] Update core.validators #1947

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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