mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #22019 -- Added Model.objects reference documentation.
This commit is contained in:
parent
a2dd618e3b
commit
5b185ecc68
5 changed files with 44 additions and 5 deletions
|
@ -681,8 +681,9 @@ Model attributes
|
|||
:class:`~django.db.models.Manager`. It's the interface through which
|
||||
database query operations are provided to Django models and is used to
|
||||
:ref:`retrieve the instances <retrieving-objects>` from the database. If no
|
||||
custom ``Manager`` is defined, the default name is ``objects``. Managers
|
||||
are only accessible via model classes, not the model instances.
|
||||
custom ``Manager`` is defined, the default name is
|
||||
:attr:`~django.db.models.Model.objects`. Managers are only accessible via
|
||||
model classes, not the model instances.
|
||||
|
||||
.. _model-methods:
|
||||
|
||||
|
|
|
@ -146,8 +146,9 @@ and a filter is a limiting clause such as ``WHERE`` or ``LIMIT``.
|
|||
|
||||
You get a :class:`~django.db.models.query.QuerySet` by using your model's
|
||||
:class:`~django.db.models.Manager`. Each model has at least one
|
||||
:class:`~django.db.models.Manager`, and it's called ``objects`` by
|
||||
default. Access it directly via the model class, like so::
|
||||
:class:`~django.db.models.Manager`, and it's called
|
||||
:attr:`~django.db.models.Model.objects` by default. Access it directly via the
|
||||
model class, like so::
|
||||
|
||||
>>> Blog.objects
|
||||
<django.db.models.manager.Manager object at ...>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue