From 29adcd215f80383f00d9f837311e857142319722 Mon Sep 17 00:00:00 2001 From: Andrew <36489577+recvfrom@users.noreply.github.com> Date: Tue, 27 Aug 2019 17:37:24 -0400 Subject: [PATCH] Fixed #30733 -- Doc'd that datetime lookups require time zone definitions in the database. Note was missing for date, year, iso_year, week, time, hour, minute, and second lookups. --- docs/ref/models/querysets.txt | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 409d8f0f29..d4b1aa55ec 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -2969,7 +2969,8 @@ Example:: implementation of the relevant query varies among different database engines.) When :setting:`USE_TZ` is ``True``, fields are converted to the current time -zone before filtering. +zone before filtering. This requires :ref:`time zone definitions in the +database `. .. fieldlookup:: year @@ -2994,7 +2995,8 @@ SQL equivalent: (The exact SQL syntax varies for each database engine.) When :setting:`USE_TZ` is ``True``, datetime fields are converted to the -current time zone before filtering. +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: iso_year @@ -3014,7 +3016,8 @@ Example:: (The exact SQL syntax varies for each database engine.) When :setting:`USE_TZ` is ``True``, datetime fields are converted to the -current time zone before filtering. +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: month @@ -3088,8 +3091,9 @@ Example:: (No equivalent SQL code fragment is included for this lookup because implementation of the relevant query varies among different database engines.) -When :setting:`USE_TZ` is ``True``, fields are converted to the current time -zone before filtering. +When :setting:`USE_TZ` is ``True``, datetime fields are converted to the +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: week_day @@ -3155,7 +3159,8 @@ Example:: implementation of the relevant query varies among different database engines.) When :setting:`USE_TZ` is ``True``, fields are converted to the current time -zone before filtering. +zone before filtering. This requires :ref:`time zone definitions in the +database `. .. fieldlookup:: hour @@ -3181,8 +3186,9 @@ SQL equivalent: (The exact SQL syntax varies for each database engine.) -For datetime fields, when :setting:`USE_TZ` is ``True``, values are converted -to the current time zone before filtering. +When :setting:`USE_TZ` is ``True``, datetime fields are converted to the +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: minute @@ -3208,8 +3214,9 @@ SQL equivalent: (The exact SQL syntax varies for each database engine.) -For datetime fields, When :setting:`USE_TZ` is ``True``, values are converted -to the current time zone before filtering. +When :setting:`USE_TZ` is ``True``, datetime fields are converted to the +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: second @@ -3235,8 +3242,9 @@ SQL equivalent: (The exact SQL syntax varies for each database engine.) -For datetime fields, when :setting:`USE_TZ` is ``True``, values are converted -to the current time zone before filtering. +When :setting:`USE_TZ` is ``True``, datetime fields are converted to the +current time zone before filtering. This requires :ref:`time zone definitions +in the database `. .. fieldlookup:: isnull