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

update django.contrib.messages to use _StrOrPromise #1274

Merged
merged 1 commit into from
Nov 28, 2022
Merged
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
38 changes: 32 additions & 6 deletions django-stubs/contrib/messages/api.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,47 @@ from typing import Any

from django.contrib.messages.storage.base import BaseStorage
from django.http.request import HttpRequest
from django.utils.functional import _StrOrPromise

class MessageFailure(Exception): ...

def add_message(
request: HttpRequest | None,
level: int,
message: str,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...
def get_messages(request: HttpRequest) -> list[Any] | BaseStorage: ...
def get_level(request: HttpRequest) -> int: ...
def set_level(request: HttpRequest, level: int) -> bool: ...
def debug(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: bool | str = ...) -> None: ...
def info(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: bool | str = ...) -> None: ...
def success(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: bool | str = ...) -> None: ...
def warning(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: bool | str = ...) -> None: ...
def error(request: HttpRequest, message: str, extra_tags: str = ..., fail_silently: bool | str = ...) -> None: ...
def debug(
request: HttpRequest,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...
def info(
request: HttpRequest,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...
def success(
request: HttpRequest,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...
def warning(
request: HttpRequest,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...
def error(
request: HttpRequest,
message: _StrOrPromise,
extra_tags: str = ...,
fail_silently: bool | str = ...,
) -> None: ...