diff --git a/django/utils/functional.py b/django/utils/functional.py index 734704f6f3..72a66917fc 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -1,3 +1,5 @@ +import copy + def curry(_curried_func, *args, **kwargs): def _curried(*moreargs, **morekwargs): return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) @@ -101,6 +103,11 @@ def lazy(func, *resultclasses): else: raise AssertionError('__mod__ not supported for non-string types') + def __deepcopy__(self, memo): + result = copy.copy(self) + memo[id(self)] = result + return result + def __wrapper__(*args, **kw): # Creates the proxy object, instead of the actual value. return __proxy__(args, kw) diff --git a/tests/regressiontests/forms/regressions.py b/tests/regressiontests/forms/regressions.py index df2ef578a1..3212e20170 100644 --- a/tests/regressiontests/forms/regressions.py +++ b/tests/regressiontests/forms/regressions.py @@ -60,6 +60,12 @@ Translated error messages used to be buggy. u'