From 3c47786cb91617b3757e57b6bfeda06ef14e561a Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 26 Jan 2014 12:46:28 +0100 Subject: Fixed #21702 -- get_model('app_label.ModelName'). Also added tests for get_model. --- docs/ref/applications.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'docs') 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. -- cgit v1.3