~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/topics/db/managers.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.1.12 upstream) (29.1.1 maverick-security)
  • Revision ID: james.westby@ubuntu.com-20101012113435-yy57c8tx6g9anf3e
Tags: 1.2.3-1ubuntu0.1
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _topics-db-managers:
2
 
 
3
1
========
4
2
Managers
5
3
========
12
10
provided to Django models. At least one ``Manager`` exists for every model in
13
11
a Django application.
14
12
 
15
 
The way ``Manager`` classes work is documented in :ref:`topics-db-queries`;
 
13
The way ``Manager`` classes work is documented in :doc:`/topics/db/queries`;
16
14
this document specifically touches on model options that customize ``Manager``
17
15
behavior.
18
16
 
170
168
If you use custom ``Manager`` objects, take note that the first ``Manager``
171
169
Django encounters (in the order in which they're defined in the model) has a
172
170
special status. Django interprets the first ``Manager`` defined in a class as
173
 
the "default" ``Manager``, and several parts of Django will use that ``Manager``
 
171
the "default" ``Manager``, and several parts of Django
 
172
(including :djadmin:`dumpdata`) will use that ``Manager``
174
173
exclusively for that model. As a result, it's a good idea to be careful in
175
174
your choice of default manager in order to avoid a situation where overriding
176
175
``get_query_set()`` results in an inability to retrieve objects you'd like to
324
323
    attribute only controlled the type of manager used for related field
325
324
    access, which is where the name came from. As it became clear the concept
326
325
    was more broadly useful, the name hasn't been changed. This is primarily
327
 
    so that existing code will :ref:`continue to work <misc-api-stability>` in
 
326
    so that existing code will :doc:`continue to work </misc/api-stability>` in
328
327
    future Django versions.
329
328
 
330
329
Writing Correct Managers For Use In Automatic Manager Instances