run black over stubs, add checking to travis

This commit is contained in:
Maxim Kurnikov
2018-12-03 18:52:44 +03:00
parent d5bc7d4ab2
commit cf6119bf9b
420 changed files with 2295 additions and 8384 deletions

View File

@@ -2,15 +2,13 @@ from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from django.db.models.base import Model
from django.db.models.fields import AutoField, Field
from django.db.models.fields.related import (ForeignKey, OneToOneField,
RelatedField)
from django.db.models.fields.related import ForeignKey, OneToOneField, RelatedField
from django.db.models.lookups import BuiltinLookup, StartsWith
from django.db.models.query_utils import FilteredRelation, PathInfo, Q
from django.db.models.sql.where import WhereNode
from .mixins import FieldCacheMixin
class ForeignObjectRel(FieldCacheMixin):
hidden: bool
many_to_many: bool
@@ -39,9 +37,7 @@ class ForeignObjectRel(FieldCacheMixin):
to: Union[Type[Model], str],
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[
Union[Callable, Dict[str, Union[int, str]], Q]
] = ...,
limit_choices_to: Optional[Union[Callable, Dict[str, Union[int, str]], Q]] = ...,
parent_link: bool = ...,
on_delete: Optional[Callable] = ...,
) -> None: ...
@@ -60,11 +56,7 @@ class ForeignObjectRel(FieldCacheMixin):
def get_internal_type(self) -> str: ...
@property
def db_type(self) -> Callable: ...
def get_choices(
self,
include_blank: bool = ...,
blank_choice: List[Tuple[str, str]] = ...,
) -> List[Tuple[int, str]]: ...
def get_choices(self, include_blank: bool = ..., blank_choice: List[Tuple[str, str]] = ...) -> List[Tuple[int, str]]: ...
def is_hidden(self) -> bool: ...
def get_joining_columns(self) -> Tuple: ...
def get_extra_restriction(
@@ -72,20 +64,14 @@ class ForeignObjectRel(FieldCacheMixin):
) -> Optional[Union[StartsWith, WhereNode]]: ...
field_name: None = ...
def set_field_name(self) -> None: ...
def get_accessor_name(
self, model: Optional[Type[Model]] = ...
) -> Optional[str]: ...
def get_path_info(
self, filtered_relation: Optional[FilteredRelation] = ...
) -> List[PathInfo]: ...
def get_accessor_name(self, model: Optional[Type[Model]] = ...) -> Optional[str]: ...
def get_path_info(self, filtered_relation: Optional[FilteredRelation] = ...) -> List[PathInfo]: ...
def get_cache_name(self) -> str: ...
class ManyToOneRel(ForeignObjectRel):
field: django.db.models.fields.related.ForeignKey
hidden: bool
limit_choices_to: Union[
Callable, Dict[str, Union[int, str]], django.db.models.query_utils.Q
]
limit_choices_to: Union[Callable, Dict[str, Union[int, str]], django.db.models.query_utils.Q]
many_to_many: bool
many_to_one: bool
model: Union[Type[django.db.models.base.Model], str]
@@ -107,9 +93,7 @@ class ManyToOneRel(ForeignObjectRel):
field_name: Optional[str],
related_name: Optional[str] = ...,
related_query_name: Optional[str] = ...,
limit_choices_to: Optional[
Union[Callable, Dict[str, Union[int, str]], Q]
] = ...,
limit_choices_to: Optional[Union[Callable, Dict[str, Union[int, str]], Q]] = ...,
parent_link: bool = ...,
on_delete: Callable = ...,
) -> None: ...