You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…1139)
* Broaden type annotation for verbose_name(_plural) to accept lazystr.
Fixes#1137.
Signed-off-by: Zixuan James Li <[email protected]>
* Broaden type annotation for help_text to accept lazystr.
Signed-off-by: Zixuan James Li <[email protected]>
* Broaden type annotation for ValidationError to accept lazystr.
Signed-off-by: Zixuan James Li <[email protected]>
* Broaden type annotation for label to accept lazystr.
Signed-off-by: Zixuan James Li <[email protected]>
* Add StrPromise and StrOrPromise aliases to django_stubs_ext.
We make StrPromise and StrOrPromise available via django_stubs_ext so
that conditional imports with TYPE_CHECKING is not required.
These aliases fall back to Promise or Union[str, Promise]
when not TYPE_CHECKING.
Signed-off-by: Zixuan James Li <[email protected]>
Signed-off-by: Zixuan James Li <[email protected]>
Bug report
What's wrong
Errors when passing
gettext_lazy
strings to parameters expecting strings likeverbose_name
andhelp_text
on model fields:(where
_
is defined asfrom django.utils.translation import gettext_lazy as _
)This was introduced in #689
How is that should be
_StrPromise
should be able to be passed as astr
.System information
python
version: 3.10django
version: 4.1mypy
version: 0.971django-stubs
version: masterdjango-stubs-ext
version: masterThe text was updated successfully, but these errors were encountered: