mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-09-21 19:23:17 +08:00
initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
class SitesConfig:
|
||||
def ready(self) -> None: ...
|
||||
@@ -0,0 +1,12 @@
|
||||
from django.apps.registry import Apps
|
||||
from django.contrib.sites.apps import SitesConfig
|
||||
|
||||
|
||||
def create_default_site(
|
||||
app_config: SitesConfig,
|
||||
verbosity: int = ...,
|
||||
interactive: bool = ...,
|
||||
using: str = ...,
|
||||
apps: Apps = ...,
|
||||
**kwargs
|
||||
) -> None: ...
|
||||
@@ -0,0 +1,11 @@
|
||||
from django.core.checks.messages import Error
|
||||
from django.db.models.query import QuerySet
|
||||
from typing import List
|
||||
|
||||
|
||||
class CurrentSiteManager:
|
||||
def __init__(self, field_name: None = ...) -> None: ...
|
||||
def _check_field_name(self) -> List[Error]: ...
|
||||
def _get_field_name(self) -> str: ...
|
||||
def check(self, **kwargs) -> List[Error]: ...
|
||||
def get_queryset(self) -> QuerySet: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
|
||||
class CurrentSiteMiddleware:
|
||||
def process_request(self, request: HttpRequest) -> None: ...
|
||||
@@ -0,0 +1,26 @@
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Optional,
|
||||
Type,
|
||||
)
|
||||
|
||||
|
||||
def _simple_domain_name_validator(value: str): ...
|
||||
|
||||
|
||||
def clear_site_cache(sender: Type[Site], **kwargs) -> None: ...
|
||||
|
||||
|
||||
class Site:
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
|
||||
class SiteManager:
|
||||
def _get_site_by_id(self, site_id: int) -> Site: ...
|
||||
def _get_site_by_request(self, request: HttpRequest) -> Site: ...
|
||||
def clear_cache(self) -> None: ...
|
||||
def get_by_natural_key(self, domain: str) -> Site: ...
|
||||
def get_current(
|
||||
self,
|
||||
request: Optional[HttpRequest] = ...
|
||||
) -> Site: ...
|
||||
@@ -0,0 +1,6 @@
|
||||
from django.http.request import HttpRequest
|
||||
|
||||
|
||||
class RequestSite:
|
||||
def __init__(self, request: HttpRequest) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
@@ -0,0 +1,12 @@
|
||||
from django.contrib.sites.models import Site
|
||||
from django.contrib.sites.requests import RequestSite
|
||||
from django.http.request import HttpRequest
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def get_current_site(
|
||||
request: Optional[HttpRequest]
|
||||
) -> Union[RequestSite, Site]: ...
|
||||
Reference in New Issue
Block a user