Ray's playground

 

Advanced Models(The Definitive Guild to Django)

  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. 

posted on 2010-03-31 09:36  Ray Z  阅读(220)  评论(0编辑  收藏  举报

导航