black reformat, some fixes

This commit is contained in:
Maxim Kurnikov
2018-12-06 19:13:06 +03:00
parent 25a71a7ef5
commit 5ec2830ba6
108 changed files with 673 additions and 187 deletions

View File

@@ -41,7 +41,9 @@ class GenericForeignKey(FieldCacheMixin):
def get_prefetch_queryset(
self, instances: Union[List[Model], QuerySet], queryset: Optional[QuerySet] = ...
) -> Tuple[List[Model], Callable, Callable, bool, str, bool]: ...
def __get__(self, instance: Optional[Model], cls: Type[Model] = ...) -> Optional[Union[GenericForeignKey, Model]]: ...
def __get__(
self, instance: Optional[Model], cls: Type[Model] = ...
) -> Optional[Union[GenericForeignKey, Model]]: ...
def __set__(self, instance: Model, value: Optional[Model]) -> None: ...
class GenericRel(ForeignObjectRel):
@@ -95,7 +97,9 @@ class GenericRelation(ForeignObject):
def set_attributes_from_rel(self) -> None: ...
def get_internal_type(self) -> str: ...
def get_content_type(self) -> ContentType: ...
def get_extra_restriction(self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str) -> WhereNode: ...
def get_extra_restriction(
self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str
) -> WhereNode: ...
def bulk_related_objects(self, objs: List[Model], using: str = ...) -> QuerySet: ...
class ReverseGenericManyToOneDescriptor(ReverseManyToOneDescriptor):

View File

@@ -24,5 +24,10 @@ def get_contenttypes_and_models(
app_config: AppConfig, using: str, ContentType: Type[ContentType]
) -> Tuple[Dict[str, ContentType], Dict[str, Type[Model]]]: ...
def create_contenttypes(
app_config: AppConfig, verbosity: int = ..., interactive: bool = ..., using: str = ..., apps: Apps = ..., **kwargs: Any
app_config: AppConfig,
verbosity: int = ...,
interactive: bool = ...,
using: str = ...,
apps: Apps = ...,
**kwargs: Any
) -> None: ...

View File

@@ -3,4 +3,6 @@ from typing import Any, Optional, Union
from django.http.request import HttpRequest
from django.http.response import HttpResponseRedirect
def shortcut(request: HttpRequest, content_type_id: Union[int, str], object_id: Union[int, str]) -> HttpResponseRedirect: ...
def shortcut(
request: HttpRequest, content_type_id: Union[int, str], object_id: Union[int, str]
) -> HttpResponseRedirect: ...