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