Loading django/db/models/fields/related.py +3 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,9 @@ def add_lazy_relation(cls, field, relation, operation): model_name = relation._meta.object_name # Try to look up the related model, and if it's already loaded resolve the # string right away. If get_model returns None, it means that the related # model isn't loaded yet, so we need to pend the relation until the class # is prepared. # string right away. If get_registered_model raises a LookupError, it means # that the related model isn't loaded yet, so we need to pend the relation # until the class is prepared. try: model = cls._meta.apps.get_registered_model(app_label, model_name) except LookupError: Loading Loading
django/db/models/fields/related.py +3 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,9 @@ def add_lazy_relation(cls, field, relation, operation): model_name = relation._meta.object_name # Try to look up the related model, and if it's already loaded resolve the # string right away. If get_model returns None, it means that the related # model isn't loaded yet, so we need to pend the relation until the class # is prepared. # string right away. If get_registered_model raises a LookupError, it means # that the related model isn't loaded yet, so we need to pend the relation # until the class is prepared. try: model = cls._meta.apps.get_registered_model(app_label, model_name) except LookupError: Loading