mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
better stubs
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
# Stubs for django.db.models.aggregates (Python 3.6)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from django.db.models.expressions import Func
|
||||
from typing import Any, Optional
|
||||
from decimal import Decimal
|
||||
from typing import Any, List, Optional, Tuple, Union
|
||||
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.models.expressions import Expression, F, Func
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.query_utils import Q
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
from typing import Any, Dict, List, Optional
|
||||
from django.db.models.sql.where import WhereNode
|
||||
|
||||
|
||||
class Aggregate(Func):
|
||||
contains_aggregate: bool = ...
|
||||
@@ -18,10 +16,16 @@ class Aggregate(Func):
|
||||
filter_template: str = ...
|
||||
window_compatible: bool = ...
|
||||
filter: Any = ...
|
||||
def __init__(self, *args: Any, filter: Optional[Any] = ..., **kwargs: Any) -> None: ...
|
||||
def get_source_fields(self) -> Any: ...
|
||||
def get_source_expressions(self) -> Any: ...
|
||||
def set_source_expressions(self, exprs: Any) -> None: ...
|
||||
def __init__(
|
||||
self, *args: Any, filter: Optional[Any] = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def get_source_fields(self) -> Union[List[None], List[Field]]: ...
|
||||
def get_source_expressions(
|
||||
self
|
||||
) -> Union[List[Union[WhereNode, Expression]], List[F]]: ...
|
||||
def set_source_expressions(
|
||||
self, exprs: List[Union[WhereNode, Expression]]
|
||||
) -> None: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
@@ -34,54 +38,79 @@ class Aggregate(Func):
|
||||
def default_alias(self) -> str: ...
|
||||
def get_group_by_cols(self) -> List[Any]: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Any: ...
|
||||
def _get_repr_options(self) -> Dict[str, Q]: ...
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[
|
||||
str,
|
||||
Union[
|
||||
List[float],
|
||||
List[str],
|
||||
List[int],
|
||||
List[Decimal],
|
||||
List[Union[int, str]],
|
||||
],
|
||||
]: ...
|
||||
|
||||
class Avg(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
def _resolve_output_field(self) -> Field: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Count(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
template: str = ...
|
||||
output_field: Any = ...
|
||||
def __init__(
|
||||
self, expression: str, distinct: bool = ..., filter: Optional[Q] = ..., **extra: Any
|
||||
self,
|
||||
expression: str,
|
||||
distinct: bool = ...,
|
||||
filter: Optional[Q] = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def _get_repr_options(self) -> Dict[str, bool]: ...
|
||||
def convert_value(
|
||||
self, value: Optional[int], expression: Count, connection: DatabaseWrapper
|
||||
self,
|
||||
value: Optional[int],
|
||||
expression: Count,
|
||||
connection: DatabaseWrapper,
|
||||
) -> int: ...
|
||||
|
||||
class Max(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class Min(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
|
||||
class StdDev(Aggregate):
|
||||
filter: None
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
function: Any = ...
|
||||
def __init__(self, expression: str, sample: bool = ..., **extra: Any) -> None: ...
|
||||
def _get_repr_options(self): ...
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self, expression: str, sample: bool = ..., **extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class Sum(Aggregate):
|
||||
filter: None
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
|
||||
class Variance(Aggregate):
|
||||
filter: None
|
||||
name: str = ...
|
||||
output_field: Any = ...
|
||||
function: Any = ...
|
||||
def __init__(self, expression: str, sample: bool = ..., **extra: Any) -> None: ...
|
||||
def _get_repr_options(self) -> Dict[str, bool]: ...
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self, expression: str, sample: bool = ..., **extra: Any
|
||||
) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user