summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-22 04:58:53 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-02-22 04:58:53 +0000
commit83e00a237158f7961b06abd31c2ed867f1831c3f (patch)
treeb93fcaf464b26b47f4c999814b960c7e993bb9fe /django
parentb7be3d63e36ee79db51dcabf0f210349e4d6f715 (diff)
queryset-refactor: Whilst writing a test to bullet-proof [7141], a bug showed up.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/models/options.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py
index 7fa7fe0174..0796a3f7c9 100644
--- a/django/db/models/options.py
+++ b/django/db/models/options.py
@@ -59,7 +59,10 @@ class Options(object):
del meta_attrs['__module__']
del meta_attrs['__doc__']
for attr_name in DEFAULT_NAMES:
- setattr(self, attr_name, meta_attrs.pop(attr_name, getattr(self, attr_name)))
+ if attr_name in meta_attrs:
+ setattr(self, attr_name, meta_attrs.pop(attr_name))
+ elif hasattr(self.meta, attr_name):
+ setattr(self, attr_name, getattr(self.meta, attr_name))
# unique_together can be either a tuple of tuples, or a single
# tuple of two strings. Normalize it to a tuple of tuples, so that