1
- from collections import OrderedDict
2
- from datetime import datetime
3
- from typing import Any , Callable , Dict , List , Optional , Set , Tuple , Union
1
+ from typing import Any , Dict , List , Optional , Set , Tuple , Union
4
2
from uuid import UUID
5
3
4
+ from django .contrib .admin .sites import AdminSite
5
+ from django .db .models .fields .reverse_related import ForeignObjectRel , ManyToOneRel
6
6
from django .forms .models import ModelChoiceIterator
7
+ from django .forms .widgets import ChoiceWidget , Media
7
8
8
9
from django import forms
9
- from django .contrib .admin .sites import AdminSite
10
- from django .db .models .fields .reverse_related import ForeignObjectRel , ManyToOneRel , ManyToManyRel
11
- from django .db .models .query_utils import Q
12
- from django .forms .fields import Field
13
- from django .forms .widgets import ChoiceWidget , Media , Widget , DateTimeBaseInput
14
- from django .http .request import QueryDict
15
- from django .utils .datastructures import MultiValueDict
16
10
17
11
class FilteredSelectMultiple (forms .SelectMultiple ):
18
12
@property
19
13
def media (self ) -> Media : ...
20
14
verbose_name : Any = ...
21
15
is_stacked : Any = ...
22
16
def __init__ (self , verbose_name : str , is_stacked : bool , attrs : None = ..., choices : Tuple = ...) -> None : ...
23
- def get_context (
24
- self , name : str , value : Union [List [Any ], str ], attrs : Optional [Dict [str , str ]]
25
- ) -> Dict [
26
- str ,
27
- Union [
28
- Dict [
29
- str ,
30
- Union [
31
- Dict [str , Union [int , str ]],
32
- List [Tuple [None , List [Dict [str , Union [Dict [Any , Any ], int , str ]]], int ]],
33
- bool ,
34
- str ,
35
- ],
36
- ],
37
- Dict [str , Union [Dict [str , Union [int , str ]], List [str ], bool , str ]],
38
- ],
39
- ]: ...
40
17
41
18
class AdminDateWidget (forms .DateInput ):
42
- attrs : Dict [str , str ]
43
- input_type : str
44
19
@property
45
20
def media (self ) -> Media : ...
46
- def __init__ (self , attrs : Optional [Dict [str , Union [int , str ]]] = ..., format : None = ...) -> None : ...
47
21
48
22
class AdminTimeWidget (forms .TimeInput ):
49
- attrs : Dict [str , str ]
50
- input_type : str
51
23
@property
52
24
def media (self ) -> Media : ...
53
- def __init__ (self , attrs : Optional [Dict [str , Union [int , str ]]] = ..., format : None = ...) -> None : ...
54
-
55
- class AdminSplitDateTime (forms .SplitDateTimeWidget ):
56
- attrs : Dict [Any , Any ]
57
- widgets : List [DateTimeBaseInput ]
58
- template_name : str = ...
59
- def __init__ (self , attrs : None = ...) -> None : ...
60
- def get_context (
61
- self , name : str , value : Optional [Union [List [str ], datetime ]], attrs : Optional [Dict [str , Union [bool , str ]]]
62
- ) -> Dict [
63
- str ,
64
- Union [
65
- Dict [
66
- str ,
67
- Optional [
68
- Union [
69
- Dict [str , Union [bool , str ]],
70
- List [Dict [str , Optional [Union [Dict [str , Union [bool , str ]], bool , str ]]]],
71
- bool ,
72
- str ,
73
- ]
74
- ],
75
- ],
76
- str ,
77
- ],
78
- ]: ...
79
-
80
- class AdminRadioSelect (forms .RadioSelect ):
81
- attrs : Dict [str , str ]
82
- template_name : str = ...
83
25
84
- class AdminFileWidget (forms .ClearableFileInput ):
85
- attrs : Dict [ Any , Any ]
86
- template_name : str = ...
26
+ class AdminSplitDateTime (forms .SplitDateTimeWidget ): ...
27
+ class AdminRadioSelect ( forms . RadioSelect ): ...
28
+ class AdminFileWidget ( forms . ClearableFileInput ): ...
87
29
88
- def url_params_from_lookup_dict (
89
- lookups : Union [
90
- Dict [str , Callable ], Dict [str , List [str ]], Dict [str , Tuple [str , str ]], Dict [str , bool ], Dict [str , str ], Q
91
- ]
92
- ) -> Dict [str , str ]: ...
30
+ def url_params_from_lookup_dict (lookups : Any ) -> Dict [str , str ]: ...
93
31
94
32
class ForeignKeyRawIdWidget (forms .TextInput ):
95
- attrs : Dict [Any , Any ]
96
- template_name : str = ...
97
33
rel : ManyToOneRel = ...
98
34
admin_site : AdminSite = ...
99
35
db : None = ...
100
36
def __init__ (self , rel : ForeignObjectRel , admin_site : AdminSite , attrs : None = ..., using : None = ...) -> None : ...
101
- def get_context (
102
- self , name : str , value : Optional [Union [List [int ], int , str , UUID ]], attrs : Optional [Dict [str , Union [bool , str ]]]
103
- ) -> Dict [str , Union [Dict [str , Optional [Union [Dict [str , Union [bool , str ]], bool , str ]]], str ]]: ...
104
37
def base_url_parameters (self ) -> Dict [str , str ]: ...
105
38
def url_parameters (self ) -> Dict [str , str ]: ...
106
39
def label_and_url_for_value (self , value : Union [int , str , UUID ]) -> Tuple [str , str ]: ...
107
40
108
- class ManyToManyRawIdWidget (ForeignKeyRawIdWidget ):
109
- admin_site : AdminSite
110
- attrs : Dict [Any , Any ]
111
- db : None
112
- rel : ManyToManyRel
113
- template_name : str = ...
114
- def get_context (
115
- self , name : str , value : Optional [List [int ]], attrs : Optional [Dict [str , str ]]
116
- ) -> Dict [str , Union [Dict [str , Union [Dict [str , str ], bool , str ]], str ]]: ...
117
- def url_parameters (self ) -> Dict [Any , Any ]: ...
118
- def label_and_url_for_value (self , value : List [int ]) -> Tuple [str , str ]: ...
119
- def value_from_datadict (self , data : QueryDict , files : MultiValueDict , name : str ) -> None : ...
120
- def format_value (self , value : Optional [List [int ]]) -> str : ...
41
+ class ManyToManyRawIdWidget (ForeignKeyRawIdWidget ): ...
121
42
122
43
class RelatedFieldWidgetWrapper (forms .Widget ):
123
44
template_name : str = ...
124
- needs_multipart_form : bool = ...
125
- attrs : Dict [Any , Any ] = ...
126
45
choices : ModelChoiceIterator = ...
127
46
widget : AutocompleteSelect = ...
128
47
rel : ManyToOneRel = ...
@@ -141,54 +60,19 @@ class RelatedFieldWidgetWrapper(forms.Widget):
141
60
can_delete_related : bool = ...,
142
61
can_view_related : bool = ...,
143
62
) -> None : ...
144
- def __deepcopy__ (
145
- self , memo : Dict [int , Union [List [Union [Field , Widget ]], OrderedDict , Field , Widget ]]
146
- ) -> RelatedFieldWidgetWrapper : ...
147
- @property
148
- def is_hidden (self ) -> bool : ...
149
63
@property
150
64
def media (self ) -> Media : ...
151
65
def get_related_url (self , info : Tuple [str , str ], action : str , * args : Any ) -> str : ...
152
- def get_context (
153
- self , name : str , value : Optional [Union [int , str ]], attrs : Optional [Dict [str , Union [bool , str ]]]
154
- ) -> Dict [str , Union [bool , str ]]: ...
155
- def value_from_datadict (
156
- self , data : QueryDict , files : MultiValueDict , name : str
157
- ) -> Optional [Union [List [str ], str ]]: ...
158
- def value_omitted_from_data (self , data : Dict [Any , Any ], files : Dict [Any , Any ], name : str ) -> bool : ...
159
- def id_for_label (self , id_ : str ) -> str : ...
160
-
161
- class AdminTextareaWidget (forms .Textarea ):
162
- attrs : Dict [str , str ]
163
- def __init__ (self , attrs : None = ...) -> None : ...
164
-
165
- class AdminTextInputWidget (forms .TextInput ):
166
- attrs : Dict [str , str ]
167
- input_type : str
168
- def __init__ (self , attrs : None = ...) -> None : ...
169
-
170
- class AdminEmailInputWidget (forms .EmailInput ):
171
- attrs : Dict [str , str ]
172
- input_type : str
173
- def __init__ (self , attrs : None = ...) -> None : ...
174
-
175
- class AdminURLFieldWidget (forms .URLInput ):
176
- attrs : Dict [str , str ]
177
- input_type : str
178
- template_name : str = ...
179
- def __init__ (self , attrs : None = ...) -> None : ...
180
- def get_context (
181
- self , name : str , value : Optional [str ], attrs : Optional [Dict [str , str ]]
182
- ) -> Dict [str , Union [Dict [str , Optional [Union [Dict [str , str ], bool , str ]]], str ]]: ...
66
+
67
+ class AdminTextareaWidget (forms .Textarea ): ...
68
+ class AdminTextInputWidget (forms .TextInput ): ...
69
+ class AdminEmailInputWidget (forms .EmailInput ): ...
70
+ class AdminURLFieldWidget (forms .URLInput ): ...
183
71
184
72
class AdminIntegerFieldWidget (forms .NumberInput ):
185
- attrs : Dict [str , str ]
186
- input_type : str
187
73
class_name : str = ...
188
- def __init__ (self , attrs : None = ...) -> None : ...
189
74
190
- class AdminBigIntegerFieldWidget (AdminIntegerFieldWidget ):
191
- class_name : str = ...
75
+ class AdminBigIntegerFieldWidget (AdminIntegerFieldWidget ): ...
192
76
193
77
SELECT2_TRANSLATIONS : Any
194
78
@@ -208,12 +92,6 @@ class AutocompleteMixin:
208
92
using : None = ...,
209
93
) -> None : ...
210
94
def get_url (self ) -> str : ...
211
- def build_attrs (
212
- self , base_attrs : Dict [str , str ], extra_attrs : Optional [Dict [str , Union [bool , str ]]] = ...
213
- ) -> Dict [str , Union [bool , str ]]: ...
214
- def optgroups (
215
- self , name : str , value : List [str ], attr : Dict [str , Union [bool , str ]] = ...
216
- ) -> List [Tuple [None , List [Dict [str , Union [Dict [str , bool ], Set [str ], int , str ]]], int ]]: ...
217
95
@property
218
96
def media (self ) -> Media : ...
219
97
0 commit comments