diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/model-api.txt | 11 |
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 ============= |
