Ticket #1658: base.diff
File base.diff, 822 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 print new_class._meta.app_label 51 46 52 47 53 # Bail out early if we have already created this class. 48 54 m = get_model(new_class._meta.app_label, name)