Skip to content

Accept StrPromise as Validator.message and missing_message #618

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

Merged
merged 1 commit into from
May 28, 2024

Conversation

q0w
Copy link
Contributor

@q0w q0w commented May 27, 2024

@q0w q0w force-pushed the me-valdiator-message branch from 6859b6c to 70ba118 Compare May 27, 2024 12:53
@q0w q0w force-pushed the me-valdiator-message branch from 70ba118 to 679667c Compare May 27, 2024 12:54
@sobolevn sobolevn merged commit 3448174 into typeddjango:master May 28, 2024
12 checks passed
@@ -2,6 +2,7 @@ from collections.abc import Callable, Container, Iterable, MutableMapping
from typing import Any, Protocol, TypeVar

from django.db.models import Model, QuerySet
from django.utils.functional import _StrOrPromise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use from django_stubs_ext import StrOrPromise, which is public API.

Copy link
Contributor Author

@q0w q0w May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked django-stubs for that, and there are no imports of StrOrPromise from django_stubs_ext.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's internal to django-stubs. Other projects should import from django_stubs_ext

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@q0w q0w deleted the me-valdiator-message branch May 28, 2024 07:11
@intgr intgr changed the title Accept Promise as Validator.message|missing_message Accept StrPromise as Validator.message and missing_message May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants