mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
SQL_IN adapter is now automatically registered
This commit is contained in:
parent
3b4c0443e4
commit
a9673f31d6
|
@ -1,5 +1,7 @@
|
||||||
2010-02-10 Federico Di Gregorio <fog@initd.org>
|
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
|
* ZPsycopgDA/db.py: removed logging debug calls; psycopg does
|
||||||
not depend on the logger module.
|
not depend on the logger module.
|
||||||
|
|
||||||
|
|
|
@ -60,9 +60,10 @@ if sys.version_info[0] >= 2 and sys.version_info[1] >= 4:
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
"can't import decimal module probably needed by _psycopg",
|
"can't import decimal module probably needed by _psycopg",
|
||||||
RuntimeWarning)
|
RuntimeWarning)
|
||||||
from psycopg2 import tz
|
|
||||||
del sys, warnings
|
del sys, warnings
|
||||||
|
|
||||||
|
from psycopg2 import tz
|
||||||
|
|
||||||
# Import the DBAPI-2.0 stuff into top-level module.
|
# Import the DBAPI-2.0 stuff into top-level module.
|
||||||
|
|
||||||
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
|
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 connect, apilevel, threadsafety, paramstyle
|
||||||
from _psycopg import __version__
|
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('_') ]
|
__all__ = [ k for k in locals().keys() if not k.startswith('_') ]
|
||||||
|
|
|
@ -110,7 +110,5 @@ class SQL_IN(object):
|
||||||
|
|
||||||
__str__ = getquoted
|
__str__ = getquoted
|
||||||
|
|
||||||
register_adapter(tuple, SQL_IN)
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = [ k for k in locals().keys() if not k.startswith('_') ]
|
__all__ = [ k for k in locals().keys() if not k.startswith('_') ]
|
||||||
|
|
|
@ -29,7 +29,6 @@ functions or used to set the .tzinfo_factory attribute in cursors.
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
ZERO = datetime.timedelta(0)
|
ZERO = datetime.timedelta(0)
|
||||||
|
|
||||||
class FixedOffsetTimezone(datetime.tzinfo):
|
class FixedOffsetTimezone(datetime.tzinfo):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user