Skip to content

Commit 24583de

Browse files
committed
Moved a backend import to allow changing the backend Haystack uses on the fly.
Useful for testing.
1 parent 520294f commit 24583de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

haystack/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import re
22
import warnings
33
from django.conf import settings
4-
from haystack import backend
54
from haystack.backends import SQ
65
from haystack.constants import REPR_OUTPUT_SIZE, ITERATOR_LOAD_PER_QUERY, DEFAULT_OPERATOR
76
from haystack.exceptions import NotRegistered
@@ -17,6 +16,7 @@ def __init__(self, site=None, query=None):
1716
if query is not None:
1817
self.query = query
1918
else:
19+
from haystack import backend
2020
self.query = backend.SearchQuery(site=site)
2121

2222
self._result_cache = []

0 commit comments

Comments
 (0)