diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2009-12-13 22:15:08 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2009-12-13 22:15:08 +0000 |
| commit | 2794cceb5f6cf21f2c99b90c9d1e79475f830460 (patch) | |
| tree | 708273f4e4cd96ca64c6f18e8de17d1055cd761f /django/utils/functional.py | |
| parent | 049dc42bdea8f524f9d52edd4ddc05ef0048d401 (diff) | |
| download | django-2794cceb5f6cf21f2c99b90c9d1e79475f830460.tar.gz | |
[soc2009/multidb] Merged up to trunk r11858.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11860 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/functional.py')
| -rw-r--r-- | django/utils/functional.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py index 434b6b76c9..823cda4587 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -277,6 +277,13 @@ class LazyObject(object): self._setup() setattr(self._wrapped, name, value) + def __delattr__(self, name): + if name == "_wrapped": + raise TypeError("can't delete _wrapped.") + if self._wrapped is None: + self._setup() + delattr(self._wrapped, name) + def _setup(self): """ Must be implemented by subclasses to initialise the wrapped object. |
