Skip to content

Commit 058d73c

Browse files
authored
accept str for Trunc expression
fixes regression in typeddjango#2167
1 parent cb73083 commit 058d73c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django-stubs/db/models/functions/datetime.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ class TruncBase(TimezoneMixin, Transform):
4141
tzinfo: Any
4242

4343
def __init__(
44-
self, expression: Expression, output_field: Field | None = ..., tzinfo: tzinfo | None = ..., **extra: Any
44+
self, expression: Expression | str, output_field: Field | None = ..., tzinfo: tzinfo | None = ..., **extra: Any
4545
) -> None: ...
4646
def as_sql(self, compiler: SQLCompiler, connection: BaseDatabaseWrapper) -> _AsSqlType: ... # type: ignore[override]
4747

4848
class Trunc(TruncBase):
4949
def __init__(
5050
self,
51-
expression: Expression,
51+
expression: Expression | str,
5252
kind: str,
5353
output_field: Field | None = ...,
5454
tzinfo: tzinfo | None = ...,

0 commit comments

Comments
 (0)