summaryrefslogtreecommitdiff
path: root/django/db/models/query_utils.py
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-12-20 02:46:58 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-12-20 02:46:58 +0000
commit20ad30713e1162b26a62920d06a4beb3f3b678d9 (patch)
tree7484a65e3de932bfdefc3925371e59ad12ac9363 /django/db/models/query_utils.py
parent25ab93457c2c294420fa50302834f3623200b690 (diff)
Fixed #11863: added a `Model.objects.raw()` method for executing raw SQL queries and yield models.
See `docs/topics/db/raw.txt` for details. Thanks to seanoc for getting the ball rolling, and to Russ for wrapping things up. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/query_utils.py')
-rw-r--r--django/db/models/query_utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py
index c5cb336f4e..746b04d4fb 100644
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -20,6 +20,13 @@ class CyclicDependency(Exception):
"""
pass
+class InvalidQuery(Exception):
+ """
+ The query passed to raw isn't a safe query to use with raw.
+ """
+ pass
+
+
class CollectedObjects(object):
"""
A container that stores keys and lists of values along with remembering the