summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-05 16:13:28 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-05 16:13:28 +0000
commit593810a5014ecaa28215839fb42f03df44a069d0 (patch)
treeddbb5c214c733e41dff49741cb3832579699b6ec /docs
parentc768bc6f25a470f4b555f0f808e9a3b6b1f37066 (diff)
Fixed #7904: added support for a "use_for_related_fields" property on managers. If True, the manager will be used for related object lookups instead of the "bare" QuerySet introduced bu [8107]. Patch from Justin Bronn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/model-api.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index f624e68844..b6a446b50e 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -1507,6 +1507,17 @@ good idea to be careful in your choice of default manager, in order to
avoid a situation where overriding of ``get_query_set()`` results in
an inability to retrieve objects you'd like to work with.
+Using managers for related object access
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+By default, Django uses a "bare" (i.e. default) manager when accessing related
+objects (i.e. ``choice.poll``). If this default isn't appropriate for your default manager, you can force Django to use a custom manager for related object attributes by giving it a ``use_for_related_fields`` property::
+
+ class MyManager(models.Manager)::
+ use_for_related_fields = True
+
+ ...
+
Model methods
=============