1 2 3 4 5 6 7 8 9 10 11 12 | # base.py
from django.db.backends.postgresql_psycopg2.base import *
from django.conf import settings
class DatabaseWrapper(DatabaseWrapper):
def _cursor(self):
cursor = super(DatabaseWrapper, self)._cursor()
statement_timeout = getattr(settings, 'DATABASE_STATEMENT_TIMEOUT', None)
if statement_timeout is not None:
cursor.execute("SET STATEMENT_TIMEOUT=%s" % statement_timeout)
return cursor
|
More like this
- model instance to sql insert statement by gsoltis 1 year, 1 month ago
- Automatically create urls for templates in a directory by blackrobot 3 months, 1 week ago
- TwitterBackend by hameedullah 2 years, 9 months ago
- PowerDNS models by diverman 2 years, 8 months ago
- Server Side Cursors for Django's psycopg2 Backend by ryanbutterfield 11 months, 2 weeks ago
Comments