티스토리 수익 글 보기
This document is for an insecure version of Django that is no longer supported. Please upgrade to a newer release!
Skip to main content
Model class reference¶
This document covers features of the Model class.
For more information about models, see the complete list of Model
reference guides.
Attributes¶
objects¶
-
Model.objects¶ Each non-abstract
Modelclass must have aManagerinstance added to it. Django ensures that in your model class you have at least a defaultManagerspecified. If you don’t add your ownManager, Django will add an attributeobjectscontaining defaultManagerinstance. If you add your ownManagerinstance 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 Managers and Retrieving objects.
Additional Information
Support Django!
Contents
Getting help
- FAQ
- Try the FAQ — it’s got answers to many common questions.
- Index, Module Index, or Table of Contents
- Handy when looking for specific information.
- Django Discord Server
- Join the Django Discord Community.
- Official Django Forum
- Join the community on the Django Forum.
- Ticket tracker
- Report bugs with Django or Django documentation in our ticket tracker.
Download:
Offline (Django 2.0):
HTML |
PDF |
ePub
Provided by Read the Docs.