SQL_IN adapter is now automatically registered

This commit is contained in:
Federico Di Gregorio 2010-02-13 00:40:29 +01:00
parent 3b4c0443e4
commit a9673f31d6
4 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,7 @@
2010-02-10 Federico Di Gregorio <fog@initd.org>
* lib/__init__: SQL_IN adapter is now automatically registered.
* ZPsycopgDA/db.py: removed logging debug calls; psycopg does
not depend on the logger module.

View File

@ -60,9 +60,10 @@ if sys.version_info[0] >= 2 and sys.version_info[1] >= 4:
warnings.warn(
"can't import decimal module probably needed by _psycopg",
RuntimeWarning)
from psycopg2 import tz
del sys, warnings
from psycopg2 import tz
# Import the DBAPI-2.0 stuff into top-level module.
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
@ -77,4 +78,9 @@ from _psycopg import NotSupportedError, OperationalError
from _psycopg import connect, apilevel, threadsafety, paramstyle
from _psycopg import __version__
# Register default adapters.
import psycopg2.extensions as _ext
_ext.register_adapter(tuple, _ext.SQL_IN)
__all__ = [ k for k in locals().keys() if not k.startswith('_') ]

View File

@ -110,7 +110,5 @@ class SQL_IN(object):
__str__ = getquoted
register_adapter(tuple, SQL_IN)
__all__ = [ k for k in locals().keys() if not k.startswith('_') ]

View File

@ -29,7 +29,6 @@ functions or used to set the .tzinfo_factory attribute in cursors.
import datetime
import time
ZERO = datetime.timedelta(0)
class FixedOffsetTimezone(datetime.tzinfo):