mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 18:05:58 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -6,11 +6,8 @@ from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template.response import TemplateResponse
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic.detail import (BaseDetailView,
|
||||
SingleObjectTemplateResponseMixin)
|
||||
from django.views.generic.list import (MultipleObjectMixin,
|
||||
MultipleObjectTemplateResponseMixin)
|
||||
|
||||
from django.views.generic.detail import BaseDetailView, SingleObjectTemplateResponseMixin
|
||||
from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin
|
||||
|
||||
class YearMixin:
|
||||
year_format: str = ...
|
||||
@@ -54,32 +51,24 @@ class DateMixin:
|
||||
class BaseDateListView(MultipleObjectMixin, DateMixin, View):
|
||||
allow_empty: bool = ...
|
||||
date_list_period: str = ...
|
||||
def get(
|
||||
self, request: WSGIRequest, *args: Any, **kwargs: Any
|
||||
) -> TemplateResponse: ...
|
||||
def get(self, request: WSGIRequest, *args: Any, **kwargs: Any) -> TemplateResponse: ...
|
||||
def get_dated_items(self) -> None: ...
|
||||
def get_ordering(self) -> Union[Tuple[str, str], str]: ...
|
||||
def get_dated_queryset(self, **lookup: Any) -> QuerySet: ...
|
||||
def get_date_list_period(self) -> str: ...
|
||||
def get_date_list(
|
||||
self, queryset: QuerySet, date_type: None = ..., ordering: str = ...
|
||||
) -> QuerySet: ...
|
||||
def get_date_list(self, queryset: QuerySet, date_type: None = ..., ordering: str = ...) -> QuerySet: ...
|
||||
|
||||
class BaseArchiveIndexView(BaseDateListView):
|
||||
context_object_name: str = ...
|
||||
def get_dated_items(self) -> Tuple[QuerySet, QuerySet, Dict[Any, Any]]: ...
|
||||
|
||||
class ArchiveIndexView(
|
||||
MultipleObjectTemplateResponseMixin, BaseArchiveIndexView
|
||||
):
|
||||
class ArchiveIndexView(MultipleObjectTemplateResponseMixin, BaseArchiveIndexView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseYearArchiveView(YearMixin, BaseDateListView):
|
||||
date_list_period: str = ...
|
||||
make_object_list: bool = ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_dated_items(self) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_make_object_list(self) -> bool: ...
|
||||
|
||||
class YearArchiveView(MultipleObjectTemplateResponseMixin, BaseYearArchiveView):
|
||||
@@ -87,44 +76,30 @@ class YearArchiveView(MultipleObjectTemplateResponseMixin, BaseYearArchiveView):
|
||||
|
||||
class BaseMonthArchiveView(YearMixin, MonthMixin, BaseDateListView):
|
||||
date_list_period: str = ...
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_dated_items(self) -> Tuple[QuerySet, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class MonthArchiveView(
|
||||
MultipleObjectTemplateResponseMixin, BaseMonthArchiveView
|
||||
):
|
||||
class MonthArchiveView(MultipleObjectTemplateResponseMixin, BaseMonthArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseWeekArchiveView(YearMixin, WeekMixin, BaseDateListView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_dated_items(self) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class WeekArchiveView(MultipleObjectTemplateResponseMixin, BaseWeekArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseDayArchiveView(YearMixin, MonthMixin, DayMixin, BaseDateListView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_dated_items(self) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class DayArchiveView(MultipleObjectTemplateResponseMixin, BaseDayArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseTodayArchiveView(BaseDayArchiveView):
|
||||
def get_dated_items(
|
||||
self
|
||||
) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
def get_dated_items(self) -> Tuple[None, QuerySet, Dict[str, Optional[date]]]: ...
|
||||
|
||||
class TodayArchiveView(
|
||||
MultipleObjectTemplateResponseMixin, BaseTodayArchiveView
|
||||
):
|
||||
class TodayArchiveView(MultipleObjectTemplateResponseMixin, BaseTodayArchiveView):
|
||||
template_name_suffix: str = ...
|
||||
|
||||
class BaseDateDetailView(
|
||||
YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailView
|
||||
):
|
||||
class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailView):
|
||||
def get_object(self, queryset: Optional[QuerySet] = ...) -> Model: ...
|
||||
|
||||
class DateDetailView(SingleObjectTemplateResponseMixin, BaseDateDetailView):
|
||||
|
||||
Reference in New Issue
Block a user