mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25205 -- Removed doc references to deprecated GeoManager class.
This commit is contained in:
committed by
Tim Graham
parent
7fa1dd8a80
commit
c9fb4f3c45
@@ -455,13 +455,10 @@ Throughout this section, we will use the term "automatic manager" to mean a
|
||||
manager that Django creates for you -- either as a default manager on a model
|
||||
with no managers, or to use temporarily when accessing related objects.
|
||||
|
||||
Sometimes this default class won't be the right choice. One example is in the
|
||||
:mod:`django.contrib.gis` application that ships with Django itself. All ``gis``
|
||||
models must use a special manager class (:class:`~django.contrib.gis.db.models.GeoManager`)
|
||||
because they need a special queryset (:class:`~django.contrib.gis.db.models.GeoQuerySet`)
|
||||
to be used for interacting with the database. It turns out that models which require
|
||||
a special manager like this need to use the same manager class wherever an automatic
|
||||
manager is created.
|
||||
Sometimes this default class won't be the right choice. The default manager
|
||||
may not have all the methods you need to work with your data. A custom manager
|
||||
class of your own will allow you to create custom ``QuerySet`` objects to give
|
||||
you the information you need.
|
||||
|
||||
Django provides a way for custom manager developers to say that their manager
|
||||
class should be used for automatic managers whenever it is the default manager
|
||||
@@ -490,8 +487,7 @@ it will use :class:`django.db.models.Manager`.
|
||||
Writing correct Managers for use in automatic Manager instances
|
||||
---------------------------------------------------------------
|
||||
|
||||
As already suggested by the :mod:`django.contrib.gis` example, above, the
|
||||
``use_for_related_fields`` feature is primarily for managers that need to
|
||||
The ``use_for_related_fields`` feature is primarily for managers that need to
|
||||
return a custom ``QuerySet`` subclass. In providing this functionality in your
|
||||
manager, there are a couple of things to remember.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user