@@ -8,7 +8,7 @@ from typing_extensions import Literal, Self
8
8
9
9
from django .core .checks import CheckMessage
10
10
from django .core .exceptions import FieldDoesNotExist as FieldDoesNotExist
11
- from django .db .models import Model
11
+ from django .db .models import Model , TextChoices
12
12
from django .db .models .expressions import Col , Combinable
13
13
from django .db .models .query_utils import RegisterLookupMixin
14
14
from django .forms import Widget
@@ -679,7 +679,8 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]):
679
679
unique_for_date : str | None = ...,
680
680
unique_for_month : str | None = ...,
681
681
unique_for_year : str | None = ...,
682
- choices : Iterable [tuple [_C , str ] | tuple [str , Iterable [tuple [_C , str ]]]] = ...,
682
+ choices : Iterable [tuple [_C , str ] | tuple [str , Iterable [tuple [_C , str ]]]]
683
+ | type [TextChoices ] = ...,
683
684
help_text : str = ...,
684
685
db_column : str | None = ...,
685
686
db_comment : str | None = ...,
@@ -706,7 +707,8 @@ class CharField(Generic[_C], Field[_C | Combinable, _C]):
706
707
unique_for_date : str | None = ...,
707
708
unique_for_month : str | None = ...,
708
709
unique_for_year : str | None = ...,
709
- choices : Iterable [tuple [_C , str ] | tuple [str , Iterable [tuple [_C , str ]]]] = ...,
710
+ choices : Iterable [tuple [_C , str ] | tuple [str , Iterable [tuple [_C , str ]]]]
711
+ | type [TextChoices ] = ...,
710
712
help_text : str = ...,
711
713
db_column : str | None = ...,
712
714
db_comment : str | None = ...,
0 commit comments