mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-14 15:57:08 +08:00
run black over stubs, add checking to travis
This commit is contained in:
@@ -8,7 +8,6 @@ from django.db.models.expressions import Value
|
||||
from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
|
||||
class Cast(Func):
|
||||
contains_aggregate: bool
|
||||
convert_value: Callable
|
||||
@@ -18,14 +17,9 @@ class Cast(Func):
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
template: str = ...
|
||||
def __init__(
|
||||
self, expression: Union[date, Decimal, Value, str], output_field: Field
|
||||
) -> None: ...
|
||||
def __init__(self, expression: Union[date, Decimal, Value, str], output_field: Field) -> None: ...
|
||||
def as_sql(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any
|
||||
) -> Tuple[str, Union[List[date], List[Decimal]]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_postgresql(self, compiler: Any, connection: Any): ...
|
||||
@@ -51,9 +45,7 @@ class Greatest(Func):
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[datetime]]: ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[datetime]]: ...
|
||||
|
||||
class Least(Func):
|
||||
contains_aggregate: bool
|
||||
@@ -65,6 +57,4 @@ class Least(Func):
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(self, *expressions: Any, **extra: Any) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[datetime]]: ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[datetime]]: ...
|
||||
|
||||
@@ -9,7 +9,6 @@ from django.db.models.fields import Field
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
from django.db.models.sql.query import Query
|
||||
|
||||
|
||||
class TimezoneMixin:
|
||||
tzinfo: Any = ...
|
||||
def get_tzname(self) -> Optional[str]: ...
|
||||
@@ -24,15 +23,9 @@ class Extract(TimezoneMixin, Transform):
|
||||
output_field: Any = ...
|
||||
tzinfo: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Expression, str],
|
||||
lookup_name: Optional[str] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
self, expression: Union[Expression, str], lookup_name: Optional[str] = ..., tzinfo: None = ..., **extra: Any
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Any]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
@@ -137,15 +130,9 @@ class TruncBase(TimezoneMixin, Transform):
|
||||
kind: Any = ...
|
||||
tzinfo: Any = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Col, str],
|
||||
output_field: Optional[Field] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
self, expression: Union[Col, str], output_field: Optional[Field] = ..., tzinfo: None = ..., **extra: Any
|
||||
) -> None: ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Any]]: ...
|
||||
def resolve_expression(
|
||||
self,
|
||||
query: Query = ...,
|
||||
@@ -154,31 +141,18 @@ class TruncBase(TimezoneMixin, Transform):
|
||||
summarize: bool = ...,
|
||||
for_save: bool = ...,
|
||||
) -> TruncBase: ...
|
||||
def convert_value(
|
||||
self,
|
||||
value: datetime,
|
||||
expression: models.functions.TruncBase,
|
||||
connection: DatabaseWrapper,
|
||||
) -> datetime: ...
|
||||
def convert_value(self, value: datetime, expression: models.functions.TruncBase, connection: DatabaseWrapper) -> datetime: ...
|
||||
|
||||
class Trunc(TruncBase):
|
||||
contains_aggregate: bool
|
||||
extra: Dict[Any, Any]
|
||||
is_summary: bool
|
||||
output_field: Union[
|
||||
models.fields.DateTimeCheckMixin,
|
||||
models.fields.IntegerField,
|
||||
]
|
||||
output_field: Union[models.fields.DateTimeCheckMixin, models.fields.IntegerField]
|
||||
source_expressions: List[Combinable]
|
||||
tzinfo: None
|
||||
kind: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: str,
|
||||
kind: str,
|
||||
output_field: Optional[Field] = ...,
|
||||
tzinfo: None = ...,
|
||||
**extra: Any
|
||||
self, expression: str, kind: str, output_field: Optional[Field] = ..., tzinfo: None = ..., **extra: Any
|
||||
) -> None: ...
|
||||
|
||||
class TruncYear(TruncBase):
|
||||
@@ -235,9 +209,7 @@ class TruncDate(TruncBase):
|
||||
kind: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: models.fields.TimeField = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class TruncTime(TruncBase):
|
||||
contains_aggregate: bool
|
||||
@@ -248,9 +220,7 @@ class TruncTime(TruncBase):
|
||||
kind: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: models.fields.DateField = ...
|
||||
def as_sql(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def as_sql(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class TruncHour(TruncBase):
|
||||
contains_aggregate: bool
|
||||
|
||||
@@ -5,14 +5,8 @@ from django.db.models import Func, Transform
|
||||
from django.db.models.expressions import Combinable, Expression, Value
|
||||
from django.db.models.sql.compiler import SQLCompiler
|
||||
|
||||
|
||||
class BytesToCharFieldConversionMixin:
|
||||
def convert_value(
|
||||
self,
|
||||
value: str,
|
||||
expression: BytesToCharFieldConversionMixin,
|
||||
connection: DatabaseWrapper,
|
||||
) -> str: ...
|
||||
def convert_value(self, value: str, expression: BytesToCharFieldConversionMixin, connection: DatabaseWrapper) -> str: ...
|
||||
|
||||
class Chr(Transform):
|
||||
contains_aggregate: bool
|
||||
@@ -24,12 +18,7 @@ class Chr(Transform):
|
||||
lookup_name: str = ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def as_oracle(self, compiler: Any, connection: Any): ...
|
||||
def as_sqlite(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[int]]: ...
|
||||
|
||||
class ConcatPair(Func):
|
||||
contains_aggregate: bool
|
||||
@@ -38,9 +27,7 @@ class ConcatPair(Func):
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[str]]: ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[str]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any): ...
|
||||
def coalesce(self) -> ConcatPair: ...
|
||||
|
||||
@@ -65,16 +52,9 @@ class Left(Func):
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
arity: int = ...
|
||||
def __init__(
|
||||
self, expression: str, length: Union[Value, int], **extra: Any
|
||||
) -> None: ...
|
||||
def __init__(self, expression: str, length: Union[Value, int], **extra: Any) -> None: ...
|
||||
def get_substr(self) -> Substr: ...
|
||||
def use_substr(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
def use_substr(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[int]]: ...
|
||||
as_oracle: Any = ...
|
||||
as_sqlite: Any = ...
|
||||
|
||||
@@ -109,13 +89,7 @@ class LPad(BytesToCharFieldConversionMixin, Func):
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: str,
|
||||
length: Union[Length, int],
|
||||
fill_text: Value = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def __init__(self, expression: str, length: Union[Length, int], fill_text: Value = ..., **extra: Any) -> None: ...
|
||||
|
||||
class LTrim(Transform):
|
||||
contains_aggregate: bool
|
||||
@@ -136,15 +110,8 @@ class Ord(Transform):
|
||||
function: str = ...
|
||||
lookup_name: str = ...
|
||||
output_field: Any = ...
|
||||
def as_mysql(
|
||||
self, compiler: Any, connection: Any, **extra_context: Any
|
||||
): ...
|
||||
def as_sqlite(
|
||||
self,
|
||||
compiler: SQLCompiler,
|
||||
connection: DatabaseWrapper,
|
||||
**extra_context: Any
|
||||
) -> Tuple[str, List[Any]]: ...
|
||||
def as_mysql(self, compiler: Any, connection: Any, **extra_context: Any): ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper, **extra_context: Any) -> Tuple[str, List[Any]]: ...
|
||||
|
||||
class Repeat(BytesToCharFieldConversionMixin, Func):
|
||||
contains_aggregate: bool
|
||||
@@ -154,15 +121,8 @@ class Repeat(BytesToCharFieldConversionMixin, Func):
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Union[Value, str],
|
||||
number: Union[Length, int],
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_oracle(
|
||||
self, compiler: Any, connection: Any, **extra_context: Any
|
||||
): ...
|
||||
def __init__(self, expression: Union[Value, str], number: Union[Length, int], **extra: Any) -> None: ...
|
||||
def as_oracle(self, compiler: Any, connection: Any, **extra_context: Any): ...
|
||||
|
||||
class Replace(Func):
|
||||
contains_aggregate: bool
|
||||
@@ -173,13 +133,7 @@ class Replace(Func):
|
||||
output_field: django.db.models.fields.CharField
|
||||
source_expressions: List[django.db.models.expressions.Combinable]
|
||||
function: str = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Combinable,
|
||||
text: Value,
|
||||
replacement: Value = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def __init__(self, expression: Combinable, text: Value, replacement: Value = ..., **extra: Any) -> None: ...
|
||||
|
||||
class Right(Left):
|
||||
contains_aggregate: bool
|
||||
@@ -238,12 +192,8 @@ class Substr(Func):
|
||||
length: Optional[Union[Value, int]] = ...,
|
||||
**extra: Any
|
||||
) -> None: ...
|
||||
def as_sqlite(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_oracle(
|
||||
self, compiler: SQLCompiler, connection: DatabaseWrapper
|
||||
) -> Tuple[str, List[int]]: ...
|
||||
def as_sqlite(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[Union[int, str]]]: ...
|
||||
def as_oracle(self, compiler: SQLCompiler, connection: DatabaseWrapper) -> Tuple[str, List[int]]: ...
|
||||
|
||||
class Trim(Transform):
|
||||
contains_aggregate: bool
|
||||
|
||||
@@ -2,7 +2,6 @@ from typing import Any, Optional, Dict, List
|
||||
|
||||
from django.db.models import Func
|
||||
|
||||
|
||||
class CumeDist(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
@@ -25,13 +24,7 @@ class FirstValue(Func):
|
||||
|
||||
class LagLeadFunction(Func):
|
||||
window_compatible: bool = ...
|
||||
def __init__(
|
||||
self,
|
||||
expression: Optional[str],
|
||||
offset: int = ...,
|
||||
default: None = ...,
|
||||
**extra: Any
|
||||
) -> Any: ...
|
||||
def __init__(self, expression: Optional[str], offset: int = ..., default: None = ..., **extra: Any) -> Any: ...
|
||||
|
||||
class Lag(LagLeadFunction):
|
||||
function: str = ...
|
||||
@@ -51,9 +44,7 @@ class NthValue(Func):
|
||||
function: str = ...
|
||||
name: str = ...
|
||||
window_compatible: bool = ...
|
||||
def __init__(
|
||||
self, expression: Optional[str], nth: int = ..., **extra: Any
|
||||
) -> Any: ...
|
||||
def __init__(self, expression: Optional[str], nth: int = ..., **extra: Any) -> Any: ...
|
||||
|
||||
class Ntile(Func):
|
||||
function: str = ...
|
||||
|
||||
Reference in New Issue
Block a user