1 | Index: /django/trunk/django/db/models/base.py
|
---|
2 | ===================================================================
|
---|
3 | --- /django/trunk/django/db/models/base.py (revision 4893)
|
---|
4 | +++ /django/trunk/django/db/models/base.py (working copy)
|
---|
5 | @@ -42,12 +42,11 @@
|
---|
6 | new_class._meta.parents.append(base)
|
---|
7 | new_class._meta.parents.extend(base._meta.parents)
|
---|
8 |
|
---|
9 | - model_module = sys.modules[new_class.__module__]
|
---|
10 | -
|
---|
11 | if getattr(new_class._meta, 'app_label', None) is None:
|
---|
12 | # Figure out the app_label by looking one level up.
|
---|
13 | # For 'django.contrib.sites.models', this would be 'sites'.
|
---|
14 | + model_module = sys.modules[new_class.__module__]
|
---|
15 | new_class._meta.app_label = model_module.__name__.split('.')[-2]
|
---|
16 |
|
---|
17 | # Bail out early if we have already created this class.
|
---|
18 | m = get_model(new_class._meta.app_label, name)
|
---|