File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 5
5
from django import template
6
6
from django .conf import settings
7
7
from django .core .exceptions import ImproperlyConfigured
8
- from django .utils import importlib , six
8
+ from django .utils import six
9
+
10
+ from haystack .utils import importlib
11
+
9
12
10
13
register = template .Library ()
11
14
Original file line number Diff line number Diff line change 11
11
from haystack .utils .highlighting import Highlighter
12
12
13
13
try :
14
- from django .utils import importlib
15
- except ImportError :
14
+ # Introduced in Python 2.7
16
15
import importlib
16
+ except ImportError :
17
+ # Deprecated in Django 1.8; removed in Django 1.9 (both of which require
18
+ # at least Python 2.7)
19
+ from django .utils import importlib
17
20
18
21
IDENTIFIER_REGEX = re .compile ('^[\w\d_]+\.[\w\d_]+\.\d+$' )
19
22
Original file line number Diff line number Diff line change 5
5
from django .conf import settings
6
6
from django .core .exceptions import ImproperlyConfigured
7
7
from django .db .models .loading import get_app , get_model , get_models
8
- from django .utils .importlib import import_module
8
+
9
+ from haystack .utils import importlib
10
+
9
11
10
12
__all__ = ['haystack_get_models' , 'haystack_load_apps' ]
11
13
@@ -56,7 +58,7 @@ def is_app_or_model(label):
56
58
57
59
def haystack_get_app_modules ():
58
60
"""Return the Python module for each installed app"""
59
- return [import_module (i ) for i in settings .INSTALLED_APPS ]
61
+ return [importlib . import_module (i ) for i in settings .INSTALLED_APPS ]
60
62
61
63
def haystack_load_apps ():
62
64
# Do all, in an INSTALLED_APPS sorted order.
Original file line number Diff line number Diff line change 8
8
9
9
from django .conf import settings
10
10
from django .core .exceptions import ImproperlyConfigured
11
- from django .utils import importlib
12
11
from django .utils .datastructures import SortedDict
13
12
from django .utils .module_loading import module_has_submodule
14
13
15
14
from haystack .exceptions import NotHandled , SearchFieldError
15
+ from haystack .utils import importlib
16
16
from haystack .utils .app_loading import haystack_get_app_modules
17
17
18
18
You can’t perform that action at this time.
0 commit comments