Ticket #4470: separate_models.9107.diff
File separate_models.9107.diff, 666 bytes (added by , 16 years ago) |
---|
-
django/db/models/base.py
48 48 # Figure out the app_label by looking one level up. 49 49 # For 'django.contrib.sites.models', this would be 'sites'. 50 50 model_module = sys.modules[new_class.__module__] 51 kwargs = {"app_label": model_module.__name__.split('.')[-2]} 51 module_names = model_module.__name__.split('.') 52 kwargs = {"app_label": module_names[module_names.index('models')-1]} 52 53 else: 53 54 kwargs = {} 54 55