Loading docs/index.txt +0 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ manipulating the data of your Web application. Learn more about it below: * **QuerySets:** :doc:`Executing queries <topics/db/queries>` | :doc:`QuerySet method reference <ref/models/querysets>` | :doc:`Query-related classes <ref/models/queries>` | :doc:`Lookup expressions <ref/models/lookups>` * **Model instances:** Loading docs/ref/models/index.txt +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ Model API reference. For introductory material, see :doc:`/topics/db/models`. options instances querysets queries lookups expressions database-functions docs/ref/models/queries.txtdeleted 100644 → 0 +0 −51 Original line number Diff line number Diff line ===================== Query-related classes ===================== .. currentmodule:: django.db.models This document provides reference material for query-related tools not documented elsewhere. ``Q()`` objects =============== .. class:: Q A ``Q()`` object, like an :class:`~django.db.models.F` object, encapsulates a SQL expression in a Python object that can be used in database-related operations. In general, ``Q() objects`` make it possible to define and reuse conditions. This permits the :ref:`construction of complex database queries <complex-lookups-with-q>` using ``|`` (``OR``) and ``&`` (``AND``) operators; in particular, it is not otherwise possible to use ``OR`` in ``QuerySets``. ``Prefetch()`` objects ====================== .. versionadded:: 1.7 .. class:: Prefetch(lookup, queryset=None, to_attr=None) The ``Prefetch()`` object can be used to control the operation of :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``lookup`` argument describes the relations to follow and works the same as the string based lookups passed to :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``queryset`` argument supplies a base ``QuerySet`` for the given lookup. This is useful to further filter down the prefetch operation, or to call :meth:`~django.db.models.query.QuerySet.select_related()` from the prefetched relation, hence reducing the number of queries even further. The ``to_attr`` argument sets the result of the prefetch operation to a custom attribute. .. note:: When using ``to_attr`` the prefetched result is stored in a list. This can provide a significant speed improvement over traditional ``prefetch_related`` calls which store the cached result within a ``QuerySet`` instance. docs/ref/models/querysets.txt +55 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ The lookup parameters (``**kwargs``) should be in the format described in `Field lookups`_ below. Multiple parameters are joined via ``AND`` in the underlying SQL statement. If you need to execute more complex queries (for example, queries with ``OR`` statements), you can use :class:`Q objects <django.db.models.Q>`. exclude ~~~~~~~ Loading Loading @@ -215,6 +218,9 @@ In SQL terms, that evaluates to:: Note the second example is more restrictive. If you need to execute more complex queries (for example, queries with ``OR`` statements), you can use :class:`Q objects <django.db.models.Q>`. annotate ~~~~~~~~ Loading Loading @@ -2843,3 +2849,52 @@ Variance extension. .. _SQLite documentation: http://www.sqlite.org/contrib Query-related classes ===================== This section provides reference material for query-related tools not documented elsewhere. ``Q()`` objects --------------- .. class:: Q A ``Q()`` object, like an :class:`~django.db.models.F` object, encapsulates a SQL expression in a Python object that can be used in database-related operations. In general, ``Q() objects`` make it possible to define and reuse conditions. This permits the :ref:`construction of complex database queries <complex-lookups-with-q>` using ``|`` (``OR``) and ``&`` (``AND``) operators; in particular, it is not otherwise possible to use ``OR`` in ``QuerySets``. ``Prefetch()`` objects ---------------------- .. versionadded:: 1.7 .. class:: Prefetch(lookup, queryset=None, to_attr=None) The ``Prefetch()`` object can be used to control the operation of :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``lookup`` argument describes the relations to follow and works the same as the string based lookups passed to :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``queryset`` argument supplies a base ``QuerySet`` for the given lookup. This is useful to further filter down the prefetch operation, or to call :meth:`~django.db.models.query.QuerySet.select_related()` from the prefetched relation, hence reducing the number of queries even further. The ``to_attr`` argument sets the result of the prefetch operation to a custom attribute. .. note:: When using ``to_attr`` the prefetched result is stored in a list. This can provide a significant speed improvement over traditional ``prefetch_related`` calls which store the cached result within a ``QuerySet`` instance. Loading
docs/index.txt +0 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ manipulating the data of your Web application. Learn more about it below: * **QuerySets:** :doc:`Executing queries <topics/db/queries>` | :doc:`QuerySet method reference <ref/models/querysets>` | :doc:`Query-related classes <ref/models/queries>` | :doc:`Lookup expressions <ref/models/lookups>` * **Model instances:** Loading
docs/ref/models/index.txt +0 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,6 @@ Model API reference. For introductory material, see :doc:`/topics/db/models`. options instances querysets queries lookups expressions database-functions
docs/ref/models/queries.txtdeleted 100644 → 0 +0 −51 Original line number Diff line number Diff line ===================== Query-related classes ===================== .. currentmodule:: django.db.models This document provides reference material for query-related tools not documented elsewhere. ``Q()`` objects =============== .. class:: Q A ``Q()`` object, like an :class:`~django.db.models.F` object, encapsulates a SQL expression in a Python object that can be used in database-related operations. In general, ``Q() objects`` make it possible to define and reuse conditions. This permits the :ref:`construction of complex database queries <complex-lookups-with-q>` using ``|`` (``OR``) and ``&`` (``AND``) operators; in particular, it is not otherwise possible to use ``OR`` in ``QuerySets``. ``Prefetch()`` objects ====================== .. versionadded:: 1.7 .. class:: Prefetch(lookup, queryset=None, to_attr=None) The ``Prefetch()`` object can be used to control the operation of :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``lookup`` argument describes the relations to follow and works the same as the string based lookups passed to :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``queryset`` argument supplies a base ``QuerySet`` for the given lookup. This is useful to further filter down the prefetch operation, or to call :meth:`~django.db.models.query.QuerySet.select_related()` from the prefetched relation, hence reducing the number of queries even further. The ``to_attr`` argument sets the result of the prefetch operation to a custom attribute. .. note:: When using ``to_attr`` the prefetched result is stored in a list. This can provide a significant speed improvement over traditional ``prefetch_related`` calls which store the cached result within a ``QuerySet`` instance.
docs/ref/models/querysets.txt +55 −0 Original line number Diff line number Diff line Loading @@ -180,6 +180,9 @@ The lookup parameters (``**kwargs``) should be in the format described in `Field lookups`_ below. Multiple parameters are joined via ``AND`` in the underlying SQL statement. If you need to execute more complex queries (for example, queries with ``OR`` statements), you can use :class:`Q objects <django.db.models.Q>`. exclude ~~~~~~~ Loading Loading @@ -215,6 +218,9 @@ In SQL terms, that evaluates to:: Note the second example is more restrictive. If you need to execute more complex queries (for example, queries with ``OR`` statements), you can use :class:`Q objects <django.db.models.Q>`. annotate ~~~~~~~~ Loading Loading @@ -2843,3 +2849,52 @@ Variance extension. .. _SQLite documentation: http://www.sqlite.org/contrib Query-related classes ===================== This section provides reference material for query-related tools not documented elsewhere. ``Q()`` objects --------------- .. class:: Q A ``Q()`` object, like an :class:`~django.db.models.F` object, encapsulates a SQL expression in a Python object that can be used in database-related operations. In general, ``Q() objects`` make it possible to define and reuse conditions. This permits the :ref:`construction of complex database queries <complex-lookups-with-q>` using ``|`` (``OR``) and ``&`` (``AND``) operators; in particular, it is not otherwise possible to use ``OR`` in ``QuerySets``. ``Prefetch()`` objects ---------------------- .. versionadded:: 1.7 .. class:: Prefetch(lookup, queryset=None, to_attr=None) The ``Prefetch()`` object can be used to control the operation of :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``lookup`` argument describes the relations to follow and works the same as the string based lookups passed to :meth:`~django.db.models.query.QuerySet.prefetch_related()`. The ``queryset`` argument supplies a base ``QuerySet`` for the given lookup. This is useful to further filter down the prefetch operation, or to call :meth:`~django.db.models.query.QuerySet.select_related()` from the prefetched relation, hence reducing the number of queries even further. The ``to_attr`` argument sets the result of the prefetch operation to a custom attribute. .. note:: When using ``to_attr`` the prefetched result is stored in a list. This can provide a significant speed improvement over traditional ``prefetch_related`` calls which store the cached result within a ``QuerySet`` instance.