Advanced Models(The Definitive Guild to Django)
2010-03-31 09:36
459 查看
In short, a model’s manager is an object through which Django models perform database queries. Each Django model has at least one manager, and you can create custom managers to customize database access. There are two reasons you might want to create a custom manager: to add extra manager methods, and/or to modify the initial QuerySet the manager returns. Adding extra manager methods is the preferred way to add table-level functionality to your models. A table-level function is one that acts on multiple instances of models, as opposed to single instances.
相关文章推荐
- Advanced Views and URLconfs(The Definitive Guild to Django)
- Models(The Definitive Guild to Django)
- Advanced Templates(The Definitive Guild to Django)
- Generating Non-HTML Content(The Definitive Guild to Django)
- Caching(The Definitive Guild to Django)
- Templates(The Definitive Guild to Django)
- The Django Admin Site(The Definitive Guild to Django)
- Views and URLconfs(The Definitive Guild to Django)
- Sessions, Users, and Registration(The Definitive Guild to Django)
- Introduction to Django(The Definitive Guild to Django)
- Getting Started(The Definitive Guild to Django)
- Forms(The Definitive Guild to Django)
- Generic Views(The Definitive Guild to Django)
- Deploying Django(The Definitive Guild to Django)
- (Django) How do I set limit_choices_to another class from where the ManyToManyField points to? - django, django-models - TechQues.com
- The Definitive Guide To Django 2 学习笔记(五) 第四章 模板 (一)基本模板系统
- The Definitive Guide to Installing Django on Ubuntu
- The Definitive Guide To Django 2 学习笔记(四) 动态URLs
- The Definitive Guide To Django 2 学习笔记(二) 第二个View 动态内容
- The Definitive Guide To Django 2 学习笔记(八) 第四章 模板 (四)基本的模板标签和过滤器