From 319de16ff0687072eefe5487b088af9e7ba11fd0 Mon Sep 17 00:00:00 2001 From: Gabriel Hurley Date: Wed, 16 Feb 2011 01:56:53 +0000 Subject: Fixed #15233 -- reST/Sphinx markup corrections in numerous areas, mostly centering around bad crossref targets. Thanks to Aryeh Leib Taurog for the draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15549 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/models/querysets.txt | 84 ++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 41 deletions(-) (limited to 'docs/ref/models') diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 973ddff7d9..cacc5e7ec3 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1749,6 +1749,8 @@ SQL equivalents:: Aggregation functions --------------------- +.. currentmodule:: django.db.models + Django provides the following aggregation functions in the ``django.db.models`` module. For details on how to use these aggregate functions, see @@ -1759,100 +1761,100 @@ Avg .. class:: Avg(field) -Returns the mean value of the given field. + Returns the mean value of the given field. - * Default alias: ``__avg`` - * Return type: float + * Default alias: ``__avg`` + * Return type: float Count ~~~~~ .. class:: Count(field, distinct=False) -Returns the number of objects that are related through the provided field. + Returns the number of objects that are related through the provided field. - * Default alias: ``__count`` - * Return type: integer + * Default alias: ``__count`` + * Return type: integer -Has one optional argument: + Has one optional argument: -.. attribute:: distinct + .. attribute:: distinct - If distinct=True, the count will only include unique instances. This has - the SQL equivalent of ``COUNT(DISTINCT field)``. Default value is ``False``. + If distinct=True, the count will only include unique instances. This has + the SQL equivalent of ``COUNT(DISTINCT field)``. Default value is ``False``. Max ~~~ .. class:: Max(field) -Returns the maximum value of the given field. + Returns the maximum value of the given field. - * Default alias: ``__max`` - * Return type: same as input field + * Default alias: ``__max`` + * Return type: same as input field Min ~~~ .. class:: Min(field) -Returns the minimum value of the given field. + Returns the minimum value of the given field. - * Default alias: ``__min`` - * Return type: same as input field + * Default alias: ``__min`` + * Return type: same as input field StdDev ~~~~~~ .. class:: StdDev(field, sample=False) -Returns the standard deviation of the data in the provided field. + Returns the standard deviation of the data in the provided field. - * Default alias: ``__stddev`` - * Return type: float + * Default alias: ``__stddev`` + * Return type: float -Has one optional argument: + Has one optional argument: -.. attribute:: sample + .. attribute:: sample - By default, ``StdDev`` returns the population standard deviation. However, - if ``sample=True``, the return value will be the sample standard deviation. + By default, ``StdDev`` returns the population standard deviation. However, + if ``sample=True``, the return value will be the sample standard deviation. -.. admonition:: SQLite + .. admonition:: SQLite - SQLite doesn't provide ``StdDev`` out of the box. An implementation is - available as an extension module for SQLite. Consult the SQlite - documentation for instructions on obtaining and installing this extension. + SQLite doesn't provide ``StdDev`` out of the box. An implementation is + available as an extension module for SQLite. Consult the SQlite + documentation for instructions on obtaining and installing this extension. Sum ~~~ .. class:: Sum(field) -Computes the sum of all values of the given field. + Computes the sum of all values of the given field. - * Default alias: ``__sum`` - * Return type: same as input field + * Default alias: ``__sum`` + * Return type: same as input field Variance ~~~~~~~~ .. class:: Variance(field, sample=False) -Returns the variance of the data in the provided field. + Returns the variance of the data in the provided field. - * Default alias: ``__variance`` - * Return type: float + * Default alias: ``__variance`` + * Return type: float -Has one optional argument: + Has one optional argument: -.. attribute:: sample + .. attribute:: sample - By default, ``Variance`` returns the population variance. However, - if ``sample=True``, the return value will be the sample variance. + By default, ``Variance`` returns the population variance. However, + if ``sample=True``, the return value will be the sample variance. -.. admonition:: SQLite + .. admonition:: SQLite - SQLite doesn't provide ``Variance`` out of the box. An implementation is - available as an extension module for SQLite. Consult the SQlite - documentation for instructions on obtaining and installing this extension. + SQLite doesn't provide ``Variance`` out of the box. An implementation is + available as an extension module for SQLite. Consult the SQlite + documentation for instructions on obtaining and installing this extension. -- cgit v1.3