Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up some small bits of the ORM, including removing an import *.

  • Loading branch information...
commit 0e296131bb9c94b9bedee34c2a30774107d1d899 1 parent 39aa890
Alex Gaynor authored
12 django/db/models/sql/compiler.py
View
@@ -4,7 +4,8 @@
from django.db import transaction
from django.db.backends.util import truncate_name
from django.db.models.query_utils import select_related_descend
-from django.db.models.sql.constants import *
+from django.db.models.sql.constants import (SINGLE, MULTI, ORDER_DIR,
+ LOOKUP_SEP, GET_ITERATOR_CHUNK_SIZE)
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.query import get_order_dir, Query
@@ -811,7 +812,7 @@ def execute_sql(self, result_type=MULTI):
raise EmptyResultSet
except EmptyResultSet:
if result_type == MULTI:
- return empty_iter()
+ return iter([])
else:
return
@@ -1088,13 +1089,6 @@ def results_iter(self):
yield date
-def empty_iter():
- """
- Returns an iterator containing no results.
- """
- yield next(iter([]))
-
-
def order_modified_iter(cursor, trim, sentinel):
"""
Yields blocks of rows from a cursor. We use this iterator in the special
5 django/db/models/sql/query.py
View
@@ -17,9 +17,9 @@
from django.db.models import signals
from django.db.models.expressions import ExpressionNode
from django.db.models.fields import FieldDoesNotExist
-from django.db.models.query_utils import InvalidQuery
from django.db.models.sql import aggregates as base_aggregates_module
-from django.db.models.sql.constants import *
+from django.db.models.sql.constants import (QUERY_TERMS, LOOKUP_SEP, ORDER_DIR,
+ SINGLE, ORDER_PATTERN, JoinInfo)
from django.db.models.sql.datastructures import EmptyResultSet, Empty, MultiJoin
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.where import (WhereNode, Constraint, EverythingNode,
@@ -28,6 +28,7 @@
__all__ = ['Query', 'RawQuery']
+
class RawQuery(object):
"""
A single raw SQL query
2  tests/modeltests/raw_query/tests.py
View
@@ -2,7 +2,7 @@
from datetime import date
-from django.db.models.sql.query import InvalidQuery
+from django.db.models.query_utils import InvalidQuery
from django.test import TestCase
from .models import Author, Book, Coffee, Reviewer, FriendlyAuthor
Please sign in to comment.
Something went wrong with that request. Please try again.