mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 20:24:31 +08:00
Add a few missing types to the stubfiles (#214)
* Add types to stub files. * Fix black and flake8 errors.
This commit is contained in:
committed by
Maksim Kurnikov
parent
83f11a0fc6
commit
7b74a6944a
3
django-stubs/core/mail/backends/smtp.pyi
Normal file
3
django-stubs/core/mail/backends/smtp.pyi
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.core.mail.backends.base import BaseEmailBackend
|
||||
|
||||
class EmailBackend(BaseEmailBackend): ...
|
||||
@@ -40,6 +40,7 @@ from .fields import (
|
||||
DurationField as DurationField,
|
||||
BigAutoField as BigAutoField,
|
||||
CommaSeparatedIntegerField as CommaSeparatedIntegerField,
|
||||
NOT_PROVIDED as NOT_PROVIDED,
|
||||
)
|
||||
|
||||
from .fields.related import (
|
||||
|
||||
@@ -25,7 +25,7 @@ from django.db.models.expressions import Combinable, Col
|
||||
from django.db.models.query_utils import RegisterLookupMixin
|
||||
from django.forms import Field as FormField, Widget
|
||||
|
||||
from .mixins import NOT_PROVIDED as NOT_PROVIDED
|
||||
class NOT_PROVIDED: ...
|
||||
|
||||
_Choice = Tuple[Any, Any]
|
||||
_ChoiceNamedGroup = Tuple[str, Iterable[_Choice]]
|
||||
@@ -129,6 +129,7 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]):
|
||||
@property
|
||||
def cached_col(self) -> Col: ...
|
||||
def value_from_object(self, obj: Model) -> _GT: ...
|
||||
def get_attname(self) -> str: ...
|
||||
|
||||
class IntegerField(Field[_ST, _GT]):
|
||||
_pyi_private_set_type: Union[float, int, str, Combinable]
|
||||
|
||||
@@ -2,6 +2,8 @@ from django.core.exceptions import ValidationError as ValidationError
|
||||
|
||||
from .forms import Form as Form, BaseForm as BaseForm
|
||||
|
||||
from .formsets import BaseFormSet as BaseFormSet, all_valid as all_valid, formset_factory as formset_factory
|
||||
|
||||
from .models import (
|
||||
ModelForm as ModelForm,
|
||||
ModelChoiceField as ModelChoiceField,
|
||||
|
||||
Reference in New Issue
Block a user