summaryrefslogtreecommitdiff
path: root/django/db/models
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models')
-rw-r--r--django/db/models/functions/datetime.py14
-rw-r--r--django/db/models/query.py7
2 files changed, 3 insertions, 18 deletions
diff --git a/django/db/models/functions/datetime.py b/django/db/models/functions/datetime.py
index 02d92a9a07..baed94227a 100644
--- a/django/db/models/functions/datetime.py
+++ b/django/db/models/functions/datetime.py
@@ -241,18 +241,14 @@ class TruncBase(TimezoneMixin, Transform):
kind = None
tzinfo = None
- # RemovedInDjango50Warning: when the deprecation ends, remove is_dst
- # argument.
def __init__(
self,
expression,
output_field=None,
tzinfo=None,
- is_dst=timezone.NOT_PASSED,
**extra,
):
self.tzinfo = tzinfo
- self.is_dst = is_dst
super().__init__(expression, output_field=output_field, **extra)
def as_sql(self, compiler, connection):
@@ -343,7 +339,7 @@ class TruncBase(TimezoneMixin, Transform):
pass
elif value is not None:
value = value.replace(tzinfo=None)
- value = timezone.make_aware(value, self.tzinfo, is_dst=self.is_dst)
+ value = timezone.make_aware(value, self.tzinfo)
elif not connection.features.has_zoneinfo_database:
raise ValueError(
"Database returned an invalid datetime value. Are time "
@@ -360,22 +356,16 @@ class TruncBase(TimezoneMixin, Transform):
class Trunc(TruncBase):
-
- # RemovedInDjango50Warning: when the deprecation ends, remove is_dst
- # argument.
def __init__(
self,
expression,
kind,
output_field=None,
tzinfo=None,
- is_dst=timezone.NOT_PASSED,
**extra,
):
self.kind = kind
- super().__init__(
- expression, output_field=output_field, tzinfo=tzinfo, is_dst=is_dst, **extra
- )
+ super().__init__(expression, output_field=output_field, tzinfo=tzinfo, **extra)
class TruncYear(TruncBase):
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 13d24bb871..c943cfe219 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1372,11 +1372,7 @@ class QuerySet(AltersData):
.order_by(("-" if order == "DESC" else "") + "datefield")
)
- # RemovedInDjango50Warning: when the deprecation ends, remove is_dst
- # argument.
- def datetimes(
- self, field_name, kind, order="ASC", tzinfo=None, is_dst=timezone.NOT_PASSED
- ):
+ def datetimes(self, field_name, kind, order="ASC", tzinfo=None):
"""
Return a list of datetime objects representing all available
datetimes for the given field_name, scoped to 'kind'.
@@ -1400,7 +1396,6 @@ class QuerySet(AltersData):
kind,
output_field=DateTimeField(),
tzinfo=tzinfo,
- is_dst=is_dst,
),
plain_field=F(field_name),
)