1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

boulder-oracle-sprint: Fix lookup unit test by catching EmptyResultSet and

returning StopIteration.


git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@4770 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2007-03-21 22:28:48 +00:00
parent 1bb9c6ffb4
commit 2c300b1dc6

View File

@ -234,6 +234,7 @@ def get_query_set_class(DefaultQuerySet):
"Create a custom QuerySet class for Oracle."
from django.db import backend, connection
from django.db.models.query import EmptyResultSet
class OracleQuerySet(DefaultQuerySet):
@ -248,7 +249,13 @@ def get_query_set_class(DefaultQuerySet):
full_query = None
select, sql, params, full_query = self._get_sql_clause(get_full_query=True)
try:
try:
select, sql, params, full_query = self._get_sql_clause(get_full_query=True)
except TypeError:
select, sql, params = self._get_sql_clause()
except EmptyResultSet:
raise StopIteration
if not full_query:
full_query = "SELECT %s%s\n%s" % \
((self._distinct and "DISTINCT " or ""),