Skip to content

Commit 875acf7

Browse files
authored
Fixed F's asc and desc args (#1213)
* fixed F asc & desc signature * improved BaseExpression asc & desc signature
1 parent 36044c9 commit 875acf7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

django-stubs/db/models/expressions.pyi

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,19 @@ class BaseExpression:
9090
def copy(self: _SelfB) -> _SelfB: ...
9191
def get_group_by_cols(self: _SelfB, alias: Optional[str] = ...) -> List[_SelfB]: ...
9292
def get_source_fields(self) -> List[Optional[Field]]: ...
93-
def asc(self, **kwargs: Any) -> OrderBy: ...
94-
def desc(self, **kwargs: Any) -> OrderBy: ...
93+
def asc(
94+
self,
95+
*,
96+
descending: bool = ...,
97+
nulls_first: bool = ...,
98+
nulls_last: bool = ...,
99+
) -> OrderBy: ...
100+
def desc(
101+
self,
102+
*,
103+
nulls_first: bool = ...,
104+
nulls_last: bool = ...,
105+
) -> OrderBy: ...
95106
def reverse_ordering(self) -> BaseExpression: ...
96107
def flatten(self) -> Iterator[BaseExpression]: ...
97108
def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ...
@@ -121,15 +132,13 @@ class F(Combinable):
121132
def asc(
122133
self,
123134
*,
124-
expression: Union[Expression, F, Subquery],
125135
descending: bool = ...,
126136
nulls_first: bool = ...,
127137
nulls_last: bool = ...,
128138
) -> OrderBy: ...
129139
def desc(
130140
self,
131141
*,
132-
expression: Union[Expression, F, Subquery],
133142
nulls_first: bool = ...,
134143
nulls_last: bool = ...,
135144
) -> OrderBy: ...

0 commit comments

Comments
 (0)