@@ -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 : Mapping [str , Any ] = ...
66
+ error_messages : Mapping [str , str ] = ...
67
+ validators : 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,10 @@ 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 = ...
118
+ trim_whitespace : bool = ...
119
+ min_length : Optional [int ] = ...
120
+ max_length : Optional [int ] = ...
105
121
def __init__ (
106
122
self ,
107
123
read_only : bool = ...,
@@ -387,6 +403,7 @@ class ChoiceField(Field):
387
403
choices : Sequence [Any ]
388
404
html_cutoff : Optional [int ] = ...
389
405
html_cutoff_text : Optional [str ] = ...
406
+ allow_blank : bool = ...
390
407
def __init__ (
391
408
self ,
392
409
choices : Sequence [Any ],
@@ -411,6 +428,7 @@ class ChoiceField(Field):
411
428
def _set_choices (self , choices : Sequence [Any ]) -> None : ...
412
429
413
430
class MultipleChoiceField (ChoiceField ):
431
+ allow_empty : bool = ...
414
432
def __init__ (
415
433
self ,
416
434
choices : Sequence [Any ],
@@ -482,6 +500,7 @@ class SupportsToPython(Protocol):
482
500
483
501
class ImageField (FileField ):
484
502
_DjangoImageField : SupportsToPython
503
+ allow_empty : bool = ...
485
504
def __init__ (
486
505
self ,
487
506
_DjangoImageField : Type [SupportsToPython ] = ...,
0 commit comments