summaryrefslogtreecommitdiff
path: root/django/db/models/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/__init__.py')
-rw-r--r--django/db/models/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/models/__init__.py b/django/db/models/__init__.py
index 0308dd047a..13832f95a3 100644
--- a/django/db/models/__init__.py
+++ b/django/db/models/__init__.py
@@ -50,4 +50,9 @@ class LazyDate(object):
return (datetime.datetime.now() + self.delta).date()
def __getattr__(self, attr):
+ if attr == 'delta':
+ # To fix ticket #3377. Note that normal accesses to LazyDate.delta
+ # (after construction) will still work, because they don't go
+ # through __getattr__). This is mainly needed for unpickling.
+ raise AttributeError
return getattr(self.__get_value__(), attr)