diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2020-12-19 20:53:30 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-12-21 09:24:41 +0100 |
| commit | 577f2338f16bea055abc49c5a43fa3ecb05dffc8 (patch) | |
| tree | eb6a5dfa1d16946da0b14a3a462bd82bf5d12942 /django/utils/functional.py | |
| parent | fe886eee36be8022f34cfe59aa61ff1c21fe01d9 (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.py | 6 |
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 |
