mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
ticket #34699. reformatting documentation with blacken-docs!
This commit is contained in:
parent
1b9e03c2e8
commit
5a7b3e8359
@ -681,16 +681,12 @@ Usage example:
|
|||||||
... trunc_start=TruncSecond("start_datetime")
|
... trunc_start=TruncSecond("start_datetime")
|
||||||
... ).filter(trunc_start__lte=start)
|
... ).filter(trunc_start__lte=start)
|
||||||
>>> find_this_exp.count()
|
>>> find_this_exp.count()
|
||||||
...
|
|
||||||
0 # We expect to find one result but 0 are found
|
0 # We expect to find one result but 0 are found
|
||||||
>>> start_adjusted = timezone.localtime(start).replace(
|
>>> start_adjusted = timezone.localtime(start).replace(tzinfo=zoneinfo.ZoneInfo(key="UTC"))
|
||||||
... tzinfo=zoneinfo.ZoneInfo(key='UTC')
|
|
||||||
... )
|
|
||||||
>>> find_this_exp_adjusted = Experiment.objects.annotate(
|
>>> find_this_exp_adjusted = Experiment.objects.annotate(
|
||||||
... trunc_start=TruncSecond("start_datetime")
|
... trunc_start=TruncSecond("start_datetime")
|
||||||
... ).filter(trunc_start__lte=start_adjusted)
|
... ).filter(trunc_start__lte=start_adjusted)
|
||||||
>>> find_this_exp.count()
|
>>> find_this_exp.count()
|
||||||
...
|
|
||||||
1
|
1
|
||||||
|
|
||||||
``DateField`` truncation
|
``DateField`` truncation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user