3 from django.db import connection, transaction
4 from django.conf import settings
8 def install_pg_fts(**kwargs):
9 f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r')
12 cursor = connection.cursor()
13 cursor.execute(f.read())
14 transaction.commit_unless_managed()
22 if settings.DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ):
23 from django.db.models.signals import post_syncdb
24 post_syncdb.connect(install_pg_fts, sender=forum.models, weak=False)
28 from south.signals import post_migrate
29 post_migrate.connect(install_pg_fts, weak=False)