Waldemar Kornewald  committed 298842b

correctly auto-install indexes

  • Participants
  • Parent commits 24785fe

Comments (0)

Files changed (3)

File dbindexer/

 from .api import FIELD_INDEXES, COLUMN_TO_NAME, get_index_name, get_column_name, regex
-from django.conf import settings
 from django.db import models
 from django.db.models.sql import aggregates as sqlaggregates
 from django.db.models.sql.constants import LOOKUP_SEP, MULTI, SINGLE, LHS_ALIAS,\
 from django.utils.tree import Node
 import re
 def contains_indexer(value):
     # In indexing mode we add all postfixes ('o', 'lo', ..., 'hello')
     result = []
 # manipulated query can result in strange behavior for these cases!
 class BaseCompiler(object):
-    def __init__(self, *args, **kwargs):
-        super(BaseCompiler, self).__init__(*args, **kwargs)
-        import_module(SITECONF_MODULE)
     def get_column_index(self, constraint):
         if constraint.field:
             column_chain = constraint.field.column

File dbindexer/

+from . import models
+class DBIndexerMiddleware(object):
+    """Empty because the import above already does everything for us"""
+    pass

File dbindexer/

+# Load the siteconf module
+from django.conf import settings
+from django.utils.importlib import import_module