From 24583decd4682e355e50803b98b3dd7ebb02b09e Mon Sep 17 00:00:00 2001 From: Daniel Lindsley Date: Thu, 20 May 2010 10:54:38 -0700 Subject: [PATCH] Moved a backend import to allow changing the backend Haystack uses on the fly. Useful for testing. --- haystack/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haystack/query.py b/haystack/query.py index f6012a804..68b034214 100644 --- a/haystack/query.py +++ b/haystack/query.py @@ -1,7 +1,6 @@ import re import warnings from django.conf import settings -from haystack import backend from haystack.backends import SQ from haystack.constants import REPR_OUTPUT_SIZE, ITERATOR_LOAD_PER_QUERY, DEFAULT_OPERATOR from haystack.exceptions import NotRegistered @@ -17,6 +16,7 @@ def __init__(self, site=None, query=None): if query is not None: self.query = query else: + from haystack import backend self.query = backend.SearchQuery(site=site) self._result_cache = []