summaryrefslogtreecommitdiff
path: root/django/utils/functional.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-12-19 20:53:30 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-12-21 09:24:41 +0100
commit577f2338f16bea055abc49c5a43fa3ecb05dffc8 (patch)
treeeb6a5dfa1d16946da0b14a3a462bd82bf5d12942 /django/utils/functional.py
parentfe886eee36be8022f34cfe59aa61ff1c21fe01d9 (diff)
Fixed #32208 -- Allowed adding lazy() objects.
Co-authored-by: Claude Paroz <claude@2xlibre.net>
Diffstat (limited to 'django/utils/functional.py')
-rw-r--r--django/utils/functional.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 6d38f932f9..5c8a0c233f 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -176,6 +176,12 @@ def lazy(func, *resultclasses):
return str(self) % rhs
return self.__cast() % rhs
+ def __add__(self, other):
+ return self.__cast() + other
+
+ def __radd__(self, other):
+ return other + self.__cast()
+
def __deepcopy__(self, memo):
# Instances of this class are effectively immutable. It's just a
# collection of functions. So we don't need to do anything