mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-18 14:29:48 +08:00
add missing files throughout the codebase (#102)
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
from datetime import datetime, timedelta
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, List, Optional, Pattern, Sequence, Type, Union
|
||||
from typing import Any, Callable, List, Optional, Pattern, Sequence, Type, Union, Tuple, Iterable
|
||||
|
||||
from django.core.validators import BaseValidator
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.widgets import Widget
|
||||
|
||||
_Choice = Tuple[Any, str]
|
||||
_ChoiceNamedGroup = Tuple[str, Iterable[_Choice]]
|
||||
_FieldChoices = Iterable[Union[_Choice, _ChoiceNamedGroup]]
|
||||
|
||||
class Field:
|
||||
initial: Any
|
||||
label: Optional[str]
|
||||
@@ -23,6 +27,9 @@ class Field:
|
||||
localize: bool = ...
|
||||
error_messages: Any = ...
|
||||
validators: List[BaseValidator] = ...
|
||||
max_length: Optional[Union[int, str]] = ...
|
||||
choices: _FieldChoices = ...
|
||||
base_field: Field
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
@@ -47,9 +54,9 @@ class Field:
|
||||
def widget_attrs(self, widget: Widget) -> Any: ...
|
||||
def has_changed(self, initial: Any, data: Any) -> bool: ...
|
||||
def get_bound_field(self, form: BaseForm, field_name: str) -> BoundField: ...
|
||||
def deconstruct(self) -> Any: ...
|
||||
|
||||
class CharField(Field):
|
||||
max_length: Optional[Union[int, str]] = ...
|
||||
min_length: Optional[Union[int, str]] = ...
|
||||
strip: bool = ...
|
||||
empty_value: Optional[str] = ...
|
||||
@@ -171,7 +178,6 @@ class RegexField(CharField):
|
||||
class EmailField(CharField): ...
|
||||
|
||||
class FileField(Field):
|
||||
max_length: Optional[int] = ...
|
||||
allow_empty_file: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Iterator, List, Mapping, Optional, Sequence, Type, Union
|
||||
|
||||
from django.core.exceptions import ValidationError as ValidationError
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.db.models.query import QuerySet
|
||||
from django.forms.boundfield import BoundField
|
||||
from django.forms.fields import Field
|
||||
from django.forms.renderers import BaseRenderer
|
||||
|
||||
Reference in New Issue
Block a user