1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Added require_ready argument to get_model methods.

This allows bringing back the behavior of Django < 1.7.

Also fixed the check for the app registry being ready in
AppConfig.get_model(s), which was inconsistent with the equivalent check in
Apps.get_model(s). That part is a backwards-incompatible change.
This commit is contained in:
Aymeric Augustin
2016-05-03 12:21:54 +02:00
committed by Tim Graham
parent fd748c42a9
commit 625cd5bcb3
4 changed files with 49 additions and 9 deletions

View File

@@ -584,7 +584,8 @@ Miscellaneous
:exc:`~django.core.exceptions.AppRegistryNotReady` if they're called before
models of all applications have been loaded. Previously they only required
the target application's models to be loaded and thus could return models
without all their relations set up.
without all their relations set up. If you need the old behavior of
``get_model()``, set the ``require_ready`` argument to ``False``.
.. _deprecated-features-1.11: