@@ -54,9 +54,20 @@ class Field:
54
54
default_validators : List [Callable ] = ...
55
55
default_empty_html : Any = ...
56
56
initial : Optional [Any ] = ...
57
+ read_only : bool = ...
58
+ write_only : bool = ...
59
+ required : bool = ...
60
+ default : Any = ...
61
+ source : Optional [Union [Callable , str ]] = ...
62
+ label : Optional [str ] = ...
63
+ help_text : Optional [str ] = ...
64
+ style : Optional [Mapping [str , Any ]] = ...
65
+ error_messages : Optional [Mapping [str , str ]] = ...
66
+ validators : Optional [List [_Validator ]] = ...
67
+ allow_null : bool = ...
68
+ field_name : Optional [str ] = ...
57
69
# TODO: add Generic/Plugin support for parent
58
- parent : Optional [Any ]
59
- validators : Optional [List [_Validator ]]
70
+ parent : Optional [Any ] = ...
60
71
def __init__ (
61
72
self ,
62
73
read_only : bool = ...,
@@ -67,10 +78,10 @@ class Field:
67
78
source : Union [Callable , str ] = ...,
68
79
label : Optional [str ] = ...,
69
80
help_text : str = ...,
70
- allow_null : bool = ...,
71
- validators : Optional [Sequence [_Validator ]] = ...,
72
- error_messages : Optional [Mapping [str , str ]] = ...,
73
81
style : Optional [Mapping [str , Any ]] = ...,
82
+ error_messages : Optional [Mapping [str , str ]] = ...,
83
+ validators : Optional [Sequence [_Validator ]] = ...,
84
+ allow_null : bool = ...,
74
85
): ...
75
86
def bind (self , field_name : str , parent : BaseSerializer ) -> None : ...
76
87
def get_validators (self ) -> List [Callable ]: ...
@@ -102,6 +113,7 @@ class NullBooleanField(Field):
102
113
class CharField (Field ):
103
114
_pyi_field_actual_type : str
104
115
_pyi_field_primitive_type : str
116
+ allow_blank : bool = ...
105
117
def __init__ (
106
118
self ,
107
119
read_only : bool = ...,
@@ -387,6 +399,7 @@ class ChoiceField(Field):
387
399
choices : Sequence [Any ]
388
400
html_cutoff : Optional [int ] = ...
389
401
html_cutoff_text : Optional [str ] = ...
402
+ allow_blank : bool = ...
390
403
def __init__ (
391
404
self ,
392
405
choices : Sequence [Any ],
@@ -411,6 +424,7 @@ class ChoiceField(Field):
411
424
def _set_choices (self , choices : Sequence [Any ]) -> None : ...
412
425
413
426
class MultipleChoiceField (ChoiceField ):
427
+ allow_empty : bool = ...
414
428
def __init__ (
415
429
self ,
416
430
choices : Sequence [Any ],
@@ -482,6 +496,7 @@ class SupportsToPython(Protocol):
482
496
483
497
class ImageField (FileField ):
484
498
_DjangoImageField : SupportsToPython
499
+ allow_empty : bool = ...
485
500
def __init__ (
486
501
self ,
487
502
_DjangoImageField : Type [SupportsToPython ] = ...,
0 commit comments