magic-removal: Fixed get_model() so that it checks app_label (allowing admin to handle
models with the same object_name but different app_labels) git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2265 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9881e049d0
commit
635dcd9c2f
|
@ -47,5 +47,6 @@ def get_model(app_label, model_name):
|
||||||
"""
|
"""
|
||||||
for app_mod in get_apps():
|
for app_mod in get_apps():
|
||||||
for model in get_models(app_mod):
|
for model in get_models(app_mod):
|
||||||
if model._meta.object_name.lower() == model_name:
|
if model._meta.object_name.lower() == model_name and \
|
||||||
|
model._meta.app_label == app_label:
|
||||||
return model
|
return model
|
||||||
|
|
Loading…
Reference in New Issue