Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango lookup types ("iexact", "icontains", "month", etc.) not working in Django nonrel (using dbindexer)
    primarykey
    data
    text
    <p>I created an app using 'django nonrel' and am using 'django dbindexer' to allow for normal Django lookups. The settings file is as below</p> <p>myproject/settings.py</p> <pre><code>from djangoappengine.settings_base import * import os DATABASES['native'] = DATABASES['default'] DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'} AUTOLOAD_SITECONF = 'indexes' SITE_ID = 1 SECRET_KEY = '=r-$b*8hglm+858&amp;9t043hlm6-&amp;6-3d3vfc4((7yd0dbrakhvi' AUTH_PROFILE_MODULE = 'myapp.UserProfile' DBINDEXER_BACKENDS = ( 'dbindexer.backends.BaseResolver', 'dbindexer.backends.FKNullFix', 'dbindexer.backends.ConstantFieldJOINResolver', ) INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.staticfiles', 'django.contrib.messages', 'djangotoolbox', 'autoload', 'dbindexer', 'myapp', 'djangoappengine', ) MIDDLEWARE_CLASSES = ( 'autoload.middleware.AutoloadMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.request', ) TEST_RUNNER = 'djangotoolbox.test.CapturingTestSuiteRunner' ROOT_URLCONF = 'myproject.urls' gettext = lambda s: s SETTINGS_PATH = os.path.abspath(os.path.dirname(__file__)) temp = os.path.join(SETTINGS_PATH, os.pardir) ROOT = os.path.join(os.path.normpath(temp)) STATIC_ROOT = os.path.join(ROOT, 'collected_static') STATIC_URL = '/static/' STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', ) AUTH_PROFILE_MODULE = 'myapp.UserProfile' </code></pre> <p>I created a 'dbindexes' file inside 'myapp' folder to add the index definitions.</p> <p>myapp/dbindexes.py</p> <pre><code>from models import * from dbindexer.lookups import StandardLookup from dbindexer.api import register_index register_index(myModel, {'first_name': 'icontains', 'last_name': 'icontains', }) </code></pre> <p>And the 'indexes' file in the main folder looks like this:</p> <p>indexes.py</p> <pre><code>from dbindexer import autodiscover autodiscover() </code></pre> <p>Now, when I query 'myModel' using the the registered indexes, it always returns an empty list. It seems that the indexes are being properly discovered as it does not throw any error. However, when I change 'icontains' to 'contains' in the 'myapp/dbindexes.py' file, it gives the expected result. </p> <p>Could someone guide me in figuring out the issue.</p> <p>Thanks!!!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload