Added in is_installed implementation for MySQL.

This commit is contained in:
Dave Hall 2011-09-11 20:38:55 +01:00
parent f09f263cce
commit 6fd002baec
2 changed files with 7 additions and 1 deletions

View file

@ -198,6 +198,12 @@ def escape_mysql_boolean_query(search_text):
class MySQLSearchBackend(SearchBackend):
def is_installed(self):
"""Checks whether django-watson is installed."""
cursor = connection.cursor()
cursor.execute("SHOW INDEX FROM watson_searchentry WHERE Key_name = 'watson_searchentry_fulltext'");
return bool(cursor.fetchall())
def do_install(self):
"""Generates the PostgreSQL specific SQL code to install django-watson."""
cursor = connection.cursor()

View file

@ -1,6 +1,6 @@
"""Adapters for registering models with django-watson."""
import re
import re, sys
from threading import local
from functools import wraps
from weakref import WeakValueDictionary