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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (4.4.9 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-5rk3p18nyanuhj6g
* 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-aggregation:
2
 
 
3
1
===========
4
2
Aggregation
5
3
===========
8
6
 
9
7
.. currentmodule:: django.db.models
10
8
 
11
 
The topic guide on :ref:`Django's database-abstraction API <topics-db-queries>`
 
9
The topic guide on :doc:`Django's database-abstraction API </topics/db/queries>`
12
10
described the way that you can use Django queries that create,
13
11
retrieve, update and delete individual objects. However, sometimes you will
14
12
need to retrieve values that are derived by summarizing or *aggregating* a
353
351
query.
354
352
 
355
353
This behavior is the same as that noted in the queryset documentation for
356
 
:ref:`distinct() <queryset-distinct>` and the general rule is the same:
 
354
:meth:`~django.db.models.QuerySet.distinct` and the general rule is the same:
357
355
normally you won't want extra columns playing a part in the result, so clear
358
356
out the ordering, or at least make sure it's restricted only to those fields
359
357
you also select in a ``values()`` call.
363
361
    for you. The main reason is consistency with ``distinct()`` and other
364
362
    places: Django **never** removes ordering constraints that you have
365
363
    specified (and we can't change those other methods' behavior, as that
366
 
    would violate our :ref:`misc-api-stability` policy).
 
364
    would violate our :doc:`/misc/api-stability` policy).
367
365
 
368
366
Aggregating annotations
369
367
-----------------------