3 from django.db import connection, transaction
4 from django.conf import settings
8 if settings.DATABASE_ENGINE in ('postgresql_psycopg2', 'postgresql', ):
9 from django.db.models.signals import post_syncdb
11 def setup_pgfulltext(sender, **kwargs):
12 if sender == forum.models:
15 post_syncdb.connect(setup_pgfulltext)
18 f = open(os.path.join(os.path.dirname(__file__), 'pg_fts_install.sql'), 'r')
21 cursor = connection.cursor()
22 cursor.execute(f.read())
23 transaction.commit_unless_managed()