diff options
| author | Aliaksandr Semianiuk <a_semianiuk@wargaming.net> | 2014-05-16 23:40:00 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-17 08:32:05 -0400 |
| commit | 5b185ecc68c04c0ee63cf44de43d831623daa263 (patch) | |
| tree | d42aa04c0be253b5b612ca4109075c326149efb3 /docs/ref | |
| parent | a2dd618e3b4a7472fab852da450ca5eef92a922f (diff) | |
Fixed #22019 -- Added Model.objects reference documentation.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/class.txt | 35 | ||||
| -rw-r--r-- | docs/ref/models/index.txt | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/docs/ref/models/class.txt b/docs/ref/models/class.txt new file mode 100644 index 0000000000..0183a82093 --- /dev/null +++ b/docs/ref/models/class.txt @@ -0,0 +1,35 @@ +===================== +Model class reference +===================== + +.. currentmodule:: django.db.models + +This document covers features of the :class:`~django.db.models.Model` class. +For more information about models, see :doc:`the complete list of Model +reference guides </ref/models/index>`. + +Attributes +========== + +``objects`` +----------- + +.. attribute:: Model.objects + + Each non-abstract :class:`~django.db.models.Model` class must have a + :class:`~django.db.models.Manager` instance added to it. + Django ensures that in your model class you have at least a + default ``Manager`` specified. If you don't add your own ``Manager``, + Django will add an attribute ``objects`` containing default + :class:`~django.db.models.Manager` instance. If you add your own + :class:`~django.db.models.Manager` instance attribute, the default one does + not appear. Consider the following example:: + + from django.db import models + + class Person(models.Model): + # Add manager with another name + people = models.Manager() + + For more details on model managers see :doc:`Managers </topics/db/managers>` + and :ref:`Retrieving objects <retrieving-objects>`. diff --git a/docs/ref/models/index.txt b/docs/ref/models/index.txt index 4716c03f95..3462420a00 100644 --- a/docs/ref/models/index.txt +++ b/docs/ref/models/index.txt @@ -9,6 +9,7 @@ Model API reference. For introductory material, see :doc:`/topics/db/models`. fields relations + class options instances querysets |
