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