Fixed #558 -- Subclassed models now use their own class name (or explicitly defined module_name) as the module_name, not the parent's module_name

git-svn-id: http://code.djangoproject.com/svn/django/trunk@697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-09-26 05:03:40 +00:00
parent fa8662a13f
commit 60bb739d9e
1 changed files with 1 additions and 1 deletions

View File

@ -430,7 +430,7 @@ class ModelBase(type):
# Pass any Options overrides to the base's Options instance, and # Pass any Options overrides to the base's Options instance, and
# simultaneously remove them from attrs. When this is done, attrs # simultaneously remove them from attrs. When this is done, attrs
# will be a dictionary of custom methods, plus __module__. # will be a dictionary of custom methods, plus __module__.
meta_overrides = {'fields': fields} meta_overrides = {'fields': fields, 'module_name': name.lower() + 's'}
for k, v in meta_attrs.items(): for k, v in meta_attrs.items():
if not callable(v) and k != '__module__': if not callable(v) and k != '__module__':
meta_overrides[k] = meta_attrs.pop(k) meta_overrides[k] = meta_attrs.pop(k)