1
0
mirror of https://github.com/django/django.git synced 2025-10-30 09:06:13 +00:00

Changes to get raw queries working on the oracle backend.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ian Kelly
2009-12-22 21:05:15 +00:00
parent cec64b96b0
commit cdf5ad4217
3 changed files with 66 additions and 47 deletions

View File

@@ -42,7 +42,9 @@ class RawQuery(object):
def get_columns(self):
if self.cursor is None:
self._execute_query()
return [column_meta[0] for column_meta in self.cursor.description]
converter = connections[self.using].introspection.table_name_converter
return [converter(column_meta[0])
for column_meta in self.cursor.description]
def validate_sql(self, sql):
if not sql.lower().strip().startswith('select'):
@@ -53,7 +55,7 @@ class RawQuery(object):
# Always execute a new query for a new iterator.
# This could be optomized with a cache at the expense of RAM.
self._execute_query()
return self.cursor
return iter(self.cursor)
def __repr__(self):
return "<RawQuery: %r>" % (self.sql % self.params)