mirror of https://github.com/django/django.git
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:
parent
fa8662a13f
commit
60bb739d9e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue