diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-28 14:55:54 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-12-28 20:53:00 +0100 |
| commit | ba7206cd81458865bace85914905392291b05829 (patch) | |
| tree | f08d8ee4e1111e71bfd13a824fa35ac8cc2ba791 /docs/ref | |
| parent | 54790e669d73269bea6320c947ed8a46e98b8025 (diff) | |
Changed get_model to raise an exception on errors.
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.
get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.
Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/applications.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt index 8f868f751e..1fc74f6bee 100644 --- a/docs/ref/applications.txt +++ b/docs/ref/applications.txt @@ -202,5 +202,5 @@ Application registry .. method:: apps.get_model(app_label, model_name) Returns the :class:`~django.db.models.Model` with the given ``app_label`` - and ``model_name``. Returns ``None`` if no such application or model - exists. ``model_name`` is case-insensitive. + and ``model_name``. Raises :exc:`~exceptions.LookupError` if no such + application or model exists. ``model_name`` is case-insensitive. |
