Expose *DATETIMETZ* objects in the extensions module

This commit is contained in:
Daniele Varrazzo 2017-03-22 03:37:41 +00:00
parent 57b1093b31
commit ee9948fa86
2 changed files with 10 additions and 4 deletions

View File

@ -823,10 +823,12 @@ from the database. See :ref:`unicode-handling` for details.
.. data:: PYDATE .. data:: PYDATE
PYDATETIME PYDATETIME
PYDATETIMETZ
PYINTERVAL PYINTERVAL
PYTIME PYTIME
PYDATEARRAY PYDATEARRAY
PYDATETIMEARRAY PYDATETIMEARRAY
PYDATETIMETZARRAY
PYINTERVALARRAY PYINTERVALARRAY
PYTIMEARRAY PYTIMEARRAY
@ -835,10 +837,12 @@ from the database. See :ref:`unicode-handling` for details.
.. data:: MXDATE .. data:: MXDATE
MXDATETIME MXDATETIME
MXDATETIMETZ
MXINTERVAL MXINTERVAL
MXTIME MXTIME
MXDATEARRAY MXDATEARRAY
MXDATETIMEARRAY MXDATETIMEARRAY
MXDATETIMETZARRAY
MXINTERVALARRAY MXINTERVALARRAY
MXTIMEARRAY MXTIMEARRAY
@ -851,3 +855,5 @@ from the database. See :ref:`unicode-handling` for details.
module. In older versions they can be imported from the implementation module. In older versions they can be imported from the implementation
module `!psycopg2._psycopg`. module `!psycopg2._psycopg`.
.. versionchanged:: 2.7.2
added `!*DATETIMETZ*` objects.

View File

@ -43,16 +43,16 @@ from psycopg2._psycopg import ( # noqa
try: try:
from psycopg2._psycopg import ( # noqa from psycopg2._psycopg import ( # noqa
MXDATE, MXDATETIME, MXINTERVAL, MXTIME, MXDATE, MXDATETIME, MXDATETIMETZ, MXINTERVAL, MXTIME, MXDATEARRAY,
MXDATEARRAY, MXDATETIMEARRAY, MXINTERVALARRAY, MXTIMEARRAY, MXDATETIMEARRAY, MXDATETIMETZARRAY, MXINTERVALARRAY, MXTIMEARRAY,
DateFromMx, TimeFromMx, TimestampFromMx, IntervalFromMx, ) DateFromMx, TimeFromMx, TimestampFromMx, IntervalFromMx, )
except ImportError: except ImportError:
pass pass
try: try:
from psycopg2._psycopg import ( # noqa from psycopg2._psycopg import ( # noqa
PYDATE, PYDATETIME, PYINTERVAL, PYTIME, PYDATE, PYDATETIME, PYDATETIMETZ, PYINTERVAL, PYTIME, PYDATEARRAY,
PYDATEARRAY, PYDATETIMEARRAY, PYINTERVALARRAY, PYTIMEARRAY, PYDATETIMEARRAY, PYDATETIMETZARRAY, PYINTERVALARRAY, PYTIMEARRAY,
DateFromPy, TimeFromPy, TimestampFromPy, IntervalFromPy, ) DateFromPy, TimeFromPy, TimestampFromPy, IntervalFromPy, )
except ImportError: except ImportError:
pass pass