mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-22 03:41:28 +08:00
initial commit
This commit is contained in:
49
django/contrib/sitemaps/__init__.pyi
Normal file
49
django/contrib/sitemaps/__init__.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
from datetime import datetime
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.core.paginator import Paginator
|
||||
from django.db.models.base import Model
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
List,
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def _get_sitemap_full_url(sitemap_url: None): ...
|
||||
|
||||
|
||||
def ping_google(sitemap_url: None = ..., ping_url: str = ...) -> None: ...
|
||||
|
||||
|
||||
class GenericSitemap:
|
||||
def __init__(
|
||||
self,
|
||||
info_dict: Dict[str, Union[QuerySet, datetime]],
|
||||
priority: Optional[float] = ...,
|
||||
changefreq: Optional[str] = ...,
|
||||
protocol: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def lastmod(self, item: Model) -> None: ...
|
||||
|
||||
|
||||
class Sitemap:
|
||||
def _urls(
|
||||
self,
|
||||
page: Union[str, int],
|
||||
protocol: str,
|
||||
domain: str
|
||||
) -> Union[List[Dict[str, Union[Model, str, None]]], List[Dict[str, object]]]: ...
|
||||
def get_urls(
|
||||
self,
|
||||
page: Union[str, int] = ...,
|
||||
site: Optional[Union[RequestSite, Site]] = ...,
|
||||
protocol: Optional[str] = ...
|
||||
) -> Union[List[Dict[str, Union[Model, str, datetime, None]]], List[Dict[str, object]]]: ...
|
||||
def items(self) -> List[Any]: ...
|
||||
def location(self, obj: Model) -> str: ...
|
||||
@property
|
||||
def paginator(self) -> Paginator: ...
|
||||
@@ -0,0 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
31
django/contrib/sitemaps/views.pyi
Normal file
31
django/contrib/sitemaps/views.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from django.template.response import TemplateResponse
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Dict,
|
||||
Optional,
|
||||
Type,
|
||||
)
|
||||
|
||||
|
||||
def index(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Dict[str, Type[Sitemap]],
|
||||
template_name: str = ...,
|
||||
content_type: str = ...,
|
||||
sitemap_url_name: str = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
def sitemap(
|
||||
request: WSGIRequest,
|
||||
sitemaps: Dict[str, Any],
|
||||
section: Optional[str] = ...,
|
||||
template_name: str = ...,
|
||||
content_type: str = ...
|
||||
) -> TemplateResponse: ...
|
||||
|
||||
|
||||
def x_robots_tag(func: Callable) -> Callable: ...
|
||||
Reference in New Issue
Block a user