summaryrefslogtreecommitdiff
path: root/django/db/backends/sqlite3/base.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2019-03-20 08:27:34 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-03-22 12:52:39 +0100
commitd26b2424437dabeeca94d7900b37d2df4410da0c (patch)
treecb08383bf787f14b91e82664ebedf84c92748e51 /django/db/backends/sqlite3/base.py
parent5935a9aeade517aebdceea989467d2b46c44d96f (diff)
downloaddjango-d26b2424437dabeeca94d7900b37d2df4410da0c.tar.gz
Fixed #30271 -- Added the Sign database function.
Diffstat (limited to 'django/db/backends/sqlite3/base.py')
-rw-r--r--django/db/backends/sqlite3/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index 7552956cd9..6a19236c48 100644
--- a/django/db/backends/sqlite3/base.py
+++ b/django/db/backends/sqlite3/base.py
@@ -231,6 +231,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
conn.create_function('SHA256', 1, none_guard(lambda x: hashlib.sha256(x.encode()).hexdigest()))
conn.create_function('SHA384', 1, none_guard(lambda x: hashlib.sha384(x.encode()).hexdigest()))
conn.create_function('SHA512', 1, none_guard(lambda x: hashlib.sha512(x.encode()).hexdigest()))
+ conn.create_function('SIGN', 1, none_guard(lambda x: (x > 0) - (x < 0)))
conn.create_function('SIN', 1, none_guard(math.sin))
conn.create_function('SQRT', 1, none_guard(math.sqrt))
conn.create_function('TAN', 1, none_guard(math.tan))