> On 26 janv. 2016, at 00:43, John Bazik <jba...@gmail.com> wrote: > > In db/models/base.py, in model_unpickle, I see this: > > if isinstance(model_id, tuple): > if not apps.ready: > apps.populate(settings.INSTALLED_APPS) > model = apps.get_model(*model_id) > > Can that test instead be "if not apps.models_ready"? That would prevent the > nested call and fix my problem.
That would be consistent with the implementation of apps.get_model() which only checks models_ready. However I think there's a bigger problem with this code. apps.populate() should only be called by django.setup(). I think we should revert 108b8bf852c76855ed98f5abe55db1da845598e7. External scripts must call django.setup() before using the ORM, whether they’re unpickling models or doing anything else with them. This was a known backwards incompatibility in 1.7: https://docs.djangoproject.com/en/1.9/releases/1.7/#standalone-scripts <https://docs.djangoproject.com/en/1.9/releases/1.7/#standalone-scripts> -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/EE1D8AB9-3741-45D6-ADD7-0A94C7F487F4%40polytechnique.org. For more options, visit https://groups.google.com/d/optout.