summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
authorAnatol Ulrich <anatol@versteht.es>2019-10-01 00:12:19 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-02 10:41:34 +0200
commit8ed6788aa479034a44a8aa87da47de56dd728c95 (patch)
tree1beb121695f5b6331bc8bc2d7fb2f7e808034026 /django/db/backends/postgresql/operations.py
parente1aa93280276c7197637a763344cb9740d0e91ff (diff)
downloaddjango-8ed6788aa479034a44a8aa87da47de56dd728c95.tar.gz
Fixed #30821 -- Added ExtractIsoWeekYear database function and iso_week_day lookup.
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index fe5b208c6a..56e1331f75 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -32,6 +32,8 @@ class DatabaseOperations(BaseDatabaseOperations):
if lookup_type == 'week_day':
# For consistency across backends, we return Sunday=1, Saturday=7.
return "EXTRACT('dow' FROM %s) + 1" % field_name
+ elif lookup_type == 'iso_week_day':
+ return "EXTRACT('isodow' FROM %s)" % field_name
elif lookup_type == 'iso_year':
return "EXTRACT('isoyear' FROM %s)" % field_name
else: