From d26b2424437dabeeca94d7900b37d2df4410da0c Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Wed, 20 Mar 2019 08:27:34 +0000 Subject: Fixed #30271 -- Added the Sign database function. --- django/db/backends/sqlite3/base.py | 1 + 1 file changed, 1 insertion(+) (limited to 'django/db/backends/sqlite3') 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)) -- cgit v1.3