diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-01-26 12:46:28 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2014-01-26 13:01:09 +0100 |
| commit | 3c47786cb91617b3757e57b6bfeda06ef14e561a (patch) | |
| tree | c6060200e2c3fa98f7326f37ba199b671ba00e62 /docs | |
| parent | 8e1fc0349124d4a792e02bfd4c90576f9e3bda95 (diff) | |
Fixed #21702 -- get_model('app_label.ModelName').
Also added tests for get_model.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/applications.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt index 2eff15d708..df105f1237 100644 --- a/docs/ref/applications.txt +++ b/docs/ref/applications.txt @@ -274,5 +274,10 @@ 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``. Raises :exc:`~exceptions.LookupError` if no such - application or model exists. ``model_name`` is case-insensitive. + and ``model_name``. As a shortcut, this method also accepts a single + argument in the form ``app_label.model_name``. ``model_name`` is case- + insensitive. + + Raises :exc:`~exceptions.LookupError` if no such application or model + exists. Raises :exc:`~exceptions.ValueError` when called with a single + argument that doesn't contain exactly one dot. |
