diff options
| author | Loic Bistuer <loic.bistuer@sixmedia.com> | 2013-07-29 16:47:49 +0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-07-31 09:54:00 -0400 |
| commit | acd1d439fd9b3e77bc0291dcd62c09f345d8622c (patch) | |
| tree | da3c4ca49f1395392ce3dfc7414dcd6cb2c21718 /docs/ref/models | |
| parent | a3a59a3197d4e03c5c016edc581bfc5f25668bca (diff) | |
Fixed #20826 -- Moved Manager.raw() and Manager._insert() to the QuerySet class.
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/querysets.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index c3f6a660b4..95dad202fa 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1262,6 +1262,28 @@ unexpectedly blocking. Using ``select_for_update`` on backends which do not support ``SELECT ... FOR UPDATE`` (such as SQLite) will have no effect. +raw +~~~ + +.. method:: raw(raw_query, params=None, translations=None) + +.. versionchanged:: 1.7 + + ``raw`` was moved to the ``QuerySet`` class. It was previously only on + :class:`~django.db.models.Manager`. + +Takes a raw SQL query, executes it, and returns a +``django.db.models.query.RawQuerySet`` instance. This ``RawQuerySet`` instance +can be iterated over just like an normal QuerySet to provide object instances. + +See the :ref:`executing-raw-queries` for more information. + +.. warning:: + + ``raw()`` always triggers a new query and doesn't account for previous + filtering. As such, it should generally be called from the ``Manager`` or + from a fresh ``QuerySet`` instance. + Methods that do not return QuerySets ------------------------------------ |
