mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-14 15:57:08 +08:00
improved version
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from django.forms.fields import Field
|
||||
from django.forms.forms import BaseForm
|
||||
from django.forms.forms import Form
|
||||
from django.forms.models import ModelForm
|
||||
from django.forms.renderers import DjangoTemplates
|
||||
from django.forms.utils import ErrorList
|
||||
from django.forms.widgets import (
|
||||
ChoiceWidget,
|
||||
HiddenInput,
|
||||
SplitHiddenDateTimeWidget,
|
||||
Widget,
|
||||
)
|
||||
from django.utils.safestring import SafeText
|
||||
from typing import (
|
||||
@@ -20,9 +22,14 @@ from typing import (
|
||||
class BoundField:
|
||||
def __getitem__(
|
||||
self,
|
||||
idx: Union[str, slice, int]
|
||||
) -> Union[BoundWidget, List[BoundWidget]]: ...
|
||||
def __init__(self, form: BaseForm, field: Field, name: str) -> None: ...
|
||||
idx: Union[slice, str, int]
|
||||
) -> Union[List[BoundWidget], BoundWidget]: ...
|
||||
def __init__(
|
||||
self,
|
||||
form: Union[Form, ModelForm],
|
||||
field: Field,
|
||||
name: str
|
||||
) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def as_hidden(self, attrs: None = ..., **kwargs) -> SafeText: ...
|
||||
def as_text(self, attrs: None = ..., **kwargs) -> SafeText: ...
|
||||
@@ -35,7 +42,11 @@ class BoundField:
|
||||
) -> SafeText: ...
|
||||
@property
|
||||
def auto_id(self) -> str: ...
|
||||
def build_widget_attrs(self, attrs: Dict[str, str], widget: Any = ...) -> Dict[str, Union[bool, str]]: ...
|
||||
def build_widget_attrs(
|
||||
self,
|
||||
attrs: Dict[str, str],
|
||||
widget: Optional[Widget] = ...
|
||||
) -> Dict[str, Union[bool, str]]: ...
|
||||
def css_classes(self, extra_classes: None = ...) -> str: ...
|
||||
@property
|
||||
def data(self) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user