Loading django/db/models/base.py +6 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ from django.db.models.query import orderlist2sql, delete_objects from django.db.models.options import Options, AdminOptions from django.db import connection, backend, transaction from django.db.models import signals from django.db.models.loading import register_models from django.db.models.loading import register_models, get_model from django.dispatch import dispatcher from django.utils.datastructures import SortedDict from django.utils.functional import curry Loading Loading @@ -60,7 +60,11 @@ class ModelBase(type): new_class._prepare() register_models(new_class._meta.app_label, new_class) return new_class # Because of the way imports happen (recursively), we may or may not be # the first class for this model to register with the framework. There # should only be one class for each model, so we must always return the # registered version. return get_model(new_class._meta.app_label, name) class Model(object): __metaclass__ = ModelBase Loading django/db/models/loading.py +0 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ def get_model(app_label, model_name): Returns the model matching the given app_label and case-insensitive model_name. Returns None if no model is found. """ get_apps() # Run get_apps() to populate the _app_list cache. Slightly hackish. try: model_dict = _app_models[app_label] except KeyError: Loading Loading
django/db/models/base.py +6 −2 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ from django.db.models.query import orderlist2sql, delete_objects from django.db.models.options import Options, AdminOptions from django.db import connection, backend, transaction from django.db.models import signals from django.db.models.loading import register_models from django.db.models.loading import register_models, get_model from django.dispatch import dispatcher from django.utils.datastructures import SortedDict from django.utils.functional import curry Loading Loading @@ -60,7 +60,11 @@ class ModelBase(type): new_class._prepare() register_models(new_class._meta.app_label, new_class) return new_class # Because of the way imports happen (recursively), we may or may not be # the first class for this model to register with the framework. There # should only be one class for each model, so we must always return the # registered version. return get_model(new_class._meta.app_label, name) class Model(object): __metaclass__ = ModelBase Loading
django/db/models/loading.py +0 −1 Original line number Diff line number Diff line Loading @@ -73,7 +73,6 @@ def get_model(app_label, model_name): Returns the model matching the given app_label and case-insensitive model_name. Returns None if no model is found. """ get_apps() # Run get_apps() to populate the _app_list cache. Slightly hackish. try: model_dict = _app_models[app_label] except KeyError: Loading