Add a few missing types to the stubfiles (#214)

* Add types to stub files.

* Fix black and flake8 errors.
This commit is contained in:
Christopher Sabater Cordero
2019-11-12 10:25:31 -05:00
committed by Maksim Kurnikov
parent 83f11a0fc6
commit 7b74a6944a
4 changed files with 8 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend): ...

View File

@@ -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 (

View File

@@ -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]

View File

@@ -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,