Ticket #4470: separate_models.7835.diff
File separate_models.7835.diff, 663 bytes (added by , 16 years ago) |
---|
-
django/db/models/base.py
56 56 # Figure out the app_label by looking one level up. 57 57 # For 'django.contrib.sites.models', this would be 'sites'. 58 58 model_module = sys.modules[new_class.__module__] 59 kwargs = {"app_label": model_module.__name__.split('.')[-2]} 59 module_name = model_module.__name__.split('.') 60 kwargs = {"app_label": module_name[module_name.index('models')-1]} 60 61 else: 61 62 kwargs = {} 62 63