1
0
mirror of https://github.com/django/django.git synced 2025-04-22 16:24:40 +00:00

magic-removal: Changed the way app_label is calculated

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-12-12 05:42:22 +00:00
parent 683e075a01
commit c6cdd4d7f6

View File

@ -778,7 +778,8 @@ class ModelBase(type):
app_label = replaces_module[0]
else:
app_package.__dict__[opts.module_name] = new_mod
app_label = app_package.__name__[app_package.__name__.rfind('.')+1:]
app_label = app_package.__name__.replace('.models', '')
app_label = app_label[app_label.rfind('.')+1:]
# Populate the _MODELS member on the module the class is in.
# Example: django.models.polls will have a _MODELS member that will