From 82aaf075f42260b0e542d7b8f3231d781983702e Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Tue, 13 Feb 2024 19:14:50 +0300 Subject: [PATCH] Add ChoicesType --- django-stubs/db/models/enums.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django-stubs/db/models/enums.pyi b/django-stubs/db/models/enums.pyi index 9ca17964b..6d1f5fc9e 100644 --- a/django-stubs/db/models/enums.pyi +++ b/django-stubs/db/models/enums.pyi @@ -2,7 +2,7 @@ import enum import sys from typing import Any, TypeVar, type_check_only -from typing_extensions import Self +from typing_extensions import Self, TypeAlias _Self = TypeVar("_Self") @@ -29,6 +29,8 @@ class ChoicesMeta(enum.EnumMeta): @property def values(self) -> list[Any]: ... +ChoicesType: TypeAlias = ChoicesMeta + class Choices(enum.Enum, metaclass=ChoicesMeta): @property def label(self) -> str: ...