Ticket #1686: base.diff
File base.diff, 766 bytes (added by , 18 years ago) |
---|
-
base.py
42 42 if getattr(new_class._meta, 'app_label', None) is None: 43 43 # Figure out the app_label by looking one level up. 44 44 # For 'django.contrib.sites.models', this would be 'sites'. 45 new_class._meta.app_label = model_module.__name__.split('.')[-2] 45 try: 46 new_class._meta.app_label = model_module.__name__.split('.')[-2] 47 except IndexError, e: 48 cwd = os.getcwd() 49 new_class._meta.app_label = os.path.basename(cwd) 50 46 51 47 52 # Bail out early if we have already created this class. 48 53 m = get_model(new_class._meta.app_label, name)