Model class reference

This document covers features of the Model class.For more information about models, see the complete list of Modelreference guides.

Attributes

objects

  • Model.objects
  • Each non-abstract Model class must have aManager instance added to it.Django ensures that in your model class you have at least adefault Manager specified. If you don't add your own Manager,Django will add an attribute objects containing defaultManager instance. If you add your ownManager instance attribute, the default one doesnot appear. Consider the following example:
  1. from django.db import models
  2.  
  3. class Person(models.Model):
  4. # Add manager with another name
  5. people = models.Manager()

For more details on model managers see Managersand Retrieving objects.