mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
PY* and MX* typecasters imported into the extensions module.
This commit is contained in:
parent
54e9c89ea4
commit
d162c08cfa
|
@ -2,6 +2,8 @@
|
|||
|
||||
* lib/extensions.py: DECIMAL typecaster imported from _psycopg.
|
||||
|
||||
* lib/extensions.py: PY* and MX* time typecaster imported from _psycopg.
|
||||
|
||||
2010-04-05 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* Fixed problem with asynchronous NOTIFYs.
|
||||
|
|
|
@ -512,7 +512,24 @@ from the database. See :ref:`unicode-handling` for details.
|
|||
UNICODE
|
||||
UNICODEARRAY
|
||||
|
||||
Typecasters to convert time-related data types to Python `!datetime` objects:
|
||||
|
||||
.. data:: PYDATE
|
||||
PYDATETIME
|
||||
PYINTERVAL
|
||||
PYTIME
|
||||
|
||||
Typecasters to convert time-related data types to `mx.DateTime`_ objects. Only
|
||||
available if Psycopg was compiled with `!mx` support.
|
||||
|
||||
.. data:: MXDATE
|
||||
MXDATETIME
|
||||
MXINTERVAL
|
||||
MXTIME
|
||||
|
||||
.. versionchanged:: 2.2.0
|
||||
previously the `DECIMAL` typecaster was not exposed by the
|
||||
`extensions` module. In older versions it can be imported from the
|
||||
implementation module `!psycopg2._psycopg`.
|
||||
previously the `DECIMAL` typecaster and the specific time-related
|
||||
typecasters (`!PY*` and `!MX*`) were not exposed by the `extensions`
|
||||
module. In older versions they can be imported from the implementation
|
||||
module `!psycopg2._psycopg`.
|
||||
|
||||
|
|
|
@ -41,11 +41,14 @@ from _psycopg import UNICODEARRAY
|
|||
|
||||
from _psycopg import Binary, Boolean, Float, QuotedString, AsIs
|
||||
try:
|
||||
from _psycopg import MXDATE, MXDATETIME, MXINTERVAL, MXTIME
|
||||
from _psycopg import DateFromMx, TimeFromMx, TimestampFromMx
|
||||
from _psycopg import IntervalFromMx
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
from _psycopg import PYDATE, PYDATETIME, PYINTERVAL, PYTIME
|
||||
from _psycopg import DateFromPy, TimeFromPy, TimestampFromPy
|
||||
from _psycopg import IntervalFromPy
|
||||
except:
|
||||
|
|
Loading…
Reference in New Issue
Block a user