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
This commit is contained in:
Jacob Kaplan-Moss 2009-12-20 02:46:58 +00:00
parent 25ab93457c
commit 20ad30713e
9 changed files with 627 additions and 23 deletions

View file

@ -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