Skip to content

Commit

Permalink
now using a DBINDEXER_SITECONF module which should call autodetect() …
Browse files Browse the repository at this point in the history
…or whatever it needs
  • Loading branch information
Waldemar Kornewald committed Dec 23, 2010
1 parent fe010a5 commit ad90881
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dbindexer/compiler.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
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,\
JOIN_TYPE, LHS_JOIN_COL, TABLE_NAME, RHS_JOIN_COL
from django.db.models.sql.where import AND, OR
from django.db.utils import DatabaseError, IntegrityError
from django.utils.importlib import import_module
from django.utils.tree import Node
import re

SITECONF_MODULE = getattr(settings, 'DBINDEXER_SITECONF', settings.ROOT_URLCONF)

def contains_indexer(value):
# In indexing mode we add all postfixes ('o', 'lo', ..., 'hello')
result = []
Expand Down Expand Up @@ -66,6 +70,10 @@ def __repr__(self):
# 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
Expand Down

0 comments on commit ad90881

Please sign in to comment.