Ticket #21794: 21794.patch

File 21794.patch, 1.4 KB (added by Aymeric Augustin, 11 years ago)
  • django/db/models/base.py

    diff --git a/django/db/models/base.py b/django/db/models/base.py
    index d7b54b9..141d28e 100644
    a b class ModelBase(type):  
    104104                # For 'django.contrib.sites.models', this would be 'sites'.
    105105                # For 'geo.models.places' this would be 'geo'.
    106106
    107                 warnings.warn(
     107                msg = (
    108108                    "Model class %s.%s doesn't declare an explicit app_label "
    109                     "and either isn't in an application in  INSTALLED_APPS "
    110                     "or else was imported before its application was loaded. "
    111                     "This will no longer be supported in Django 1.9."
    112                     % (module, name), PendingDeprecationWarning, stacklevel=2)
     109                    "and either isn't in an application in INSTALLED_APPS or "
     110                    "else was imported before its application was loaded. " %
     111                    (module, name))
     112                if abstract:
     113                    msg += "Its app_label will be set to None in Django 1.9."
     114                else:
     115                    msg += "This will no longer be supported in Django 1.9."
     116                warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
    113117
    114118                model_module = sys.modules[new_class.__module__]
    115119                package_components = model_module.__name__.split('.')
Back to Top